php 正则问题,我想匹配(rn)出现两次的地方分割
程序员文章站
2022-05-05 22:47:56
...
$str = "fhd\r\n\r\nfdfk\r\n\r\nuuuuu";
$data = preg_split("(\r\n){2}", $str, -1);
print_r($data);
结果:
回复内容:
$str = "fhd\r\n\r\nfdfk\r\n\r\nuuuuu";
$data = preg_split("(\r\n){2}", $str, -1);
print_r($data);
结果:
$str = "fhd\r\n\r\nfdfk\r\n\r\nuuuuu";
$data = preg_split("/(\r\n){2}/", $str, -1);
print_r($data);
下一篇: php基本函数汇总_PHP