$s = 'aaaa ';
bbbb
cccc
dddd
echo preg_replace('/
\w+/', '', $s, 2);
aaaa
dddd
echo preg_replace('/
[^<]+/', '', $s, 2);
echo preg_replace('/\(.+?\)/', '', $s);
echo preg_replace_callback('/
[^<]+/', 'foo', $s, 2);
function foo($m){
return strpos($m[0], '(') !== false ? preg_replace('/\(.+?\)/','',$m[0]) : '';
}
Copyright 2014-2023 //m.sbmmt.com/ All Rights Reserved | 苏州跃动光标网络科技有限公司 | 苏ICP备2020058653号-1
| 本站CDN由 数掘科技 提供