PHP中使用SPLIT()时出现Warning: split(): REG_EMPTY错误的解决办法

PHP中使用SPLIT()时出现Warning: split(): REG_EMPTY错误的解决办法: 


很有可能是由于使用了“|”做分隔符,像这样:

$Arr = split('|', $string);


此时需要对“|”进行转义,这样使用“\|”:

$Arr = split('\|', $string);


就可以了。


如需转载,请注明出处: https://www.chadou.me/p/113

最新发布