<?php //请修改变量p的正则表达式,使他能够匹配BBC $p = '/http:\/\//'; $str = "http://www.imooc.com"; if (preg_match($p, $str)) { echo '匹配成功'; echo "<br>"; $p1 = 'http://'; $p1 = '/'.preg_quote($p1,'/').'/'; echo preg_match($p1,$str)."<br>"; if($p == $p1) echo "true"; else { echo " ".$p."<br>"." ".$p1; } }
举报
0/150
提交
取消