$p='/\w+\.(php|css|js)/';
$r='<em>$0</em>';
echo preg_replace($p,$r,$str);
$r='<em>$0</em>';
echo preg_replace($p,$r,$str);
2016-07-12
已采纳回答 / 慕粉3513192
单引号内部的变量不会执行双引号会执行如$name = 'hello';echo "the $name";会输出 the hello而如果是单引号$name = 'hello';echo 'the $name';会输出 the $name
2016-07-12
最新回答 / 奋_斗
(19|20)(\d{2})-(\d{1,2})-(\d{1,2})/', '/^\s*{(\w+)}\s*匹配的应该是这个:1990-11-1或者2001-5-1之类的
2016-07-12