$string = 'caoyang@sina.com'; // 匹配@之后的部分 $preg = '/(?<=@).*/'; $status = preg_match_all($preg, $string, $matches); echo $status; var_dump($matches);
$string = 'caoyang@sina.com'; // 匹配@之后的部分 $preg = '/(?<=@).*/'; $status = preg_match_all($preg, $string, $matches); echo $status; var_dump($matches);
转载于:https://www.cnblogs.com/xiaobiaomei/p/10812567.html