日期:2014-05-17 浏览次数:20479 次
[liangdong@bb-browser-test00.vm.baidu.com php_project]$ php main.php Array ( [0] => @中肖 [1] => @尖 [2] => @地s_3法 [3] => @在有 ) [liangdong@bb-browser-test00.vm.baidu.com php_project]$ cat main.php <?php $content = "@中肖 @尖 困@地s_3法 @在有 @ "; $n_match = preg_match_all('/@.* /U', $content, $matches); if ($n_match) { $res = array_filter($matches[0], function($item){return trim($item, "@ ");}); print_r($res); } ?>