js:
str.search(value) 用于查詢字符串所在的位置
str.match(regexp) 在字符串內(nèi)檢索指定的值
str.replace(searchvalue/regep,newvalue) 在字符串中用一些字符替換另一些字符,或替換一個與正則表達(dá)式匹配的子串。
str.split(separator,limit) 用于把一個字符串分割成字符串?dāng)?shù)組。
i g m
php:
preg_match(pattern,string,matches) 匹配一次
preg_match_all(pattern,string,matches) 全部匹配
preg_replace($patterns, $replacements, $string);
implode(separator,arr) 把數(shù)組按分隔符 連接為字符串
explode(separator,string) 把字符串按分隔符 拆分成 數(shù)組