php 正则替换

$str = "The quick brown fox jumped over the lazy dog.";
$str = preg_replace('/\s/','-',$str);
echo $str;

更详细的请看原著
摘抄自http://www.5idev.com/p-php_preg_replace.shtml
posted @ 2017-10-22 17:11  西瓜霜  阅读(589)  评论(0编辑  收藏  举报