preg_replace all spaces

后端 未结 5 413
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-03 20:28

I\'m trying to replace all spaces with underscores and the following is not working:

$id = \"aa aa\";
echo $id;
preg_replace(\'/\\s+/\', \'_\', $id);
echo $i         


        
5条回答
提交回复
热议问题