php 正则替换字符串问题?
发布网友
发布时间:2022-10-27 17:04
我来回答
共1个回答
热心网友
时间:2023-09-27 18:05
$contents = "aaaaaa aaa aaa aaa aaa";
$contents = preg_replace('/(\s+)aaa(\s?)/','b ',$contents);
$contents = preg_replace('/(\s+)aaa/','b',$contents);
热心网友
时间:2023-09-27 18:05
$contents = "aaaaaa aaa aaa aaa aaa";
$contents = preg_replace('/(\s+)aaa(\s?)/','b ',$contents);
$contents = preg_replace('/(\s+)aaa/','b',$contents);