preg_match
字符串比對解析。
語法: int preg_match(string pattern, string subject, array [matches]);
返回值: 整數/數組
函數種類: 資料處理
本函數以 pattern 的規則來解析比對字符串 subject。比對結果返回的值放在數組參數 matches 之中,matches[0] 內容就是原字符串 subject、matches[1] 為第一個合乎規則的字符串、matches[2] 就是第二個合乎規則的字符串,餘類推。若省略參數 matches,則隻是單純地比對,找到則返回值為 true。
整理: 夕垌菪姬 (天地JPLOP)
|