php正則表達(dá)式匹配分隔符?
<?php //php正則用任意分隔符(" " "," "/" "!")分割字符串成數(shù)組$str = "Hello world!Hello,world!Hello/world";$str = preg_split("/[\s,\/!]+/", $str);echo '<pre>';print_r($str);?>
運(yùn)行輸出為:Array( [0] => Hello [1] => world [2] => Hello [3] => world [4] => Hello [5] => world)希望對(duì)你有所幫助。