php代码:
<?php
$string = "html hell ";
preg_match_all("/<c/",$string,$matches);
print_r($matches);
?>
输出结果:
Array ( [0] => Array ( [0] =>
后面什么都没有了。
如果只匹配尖括号,是可以的
<?php
$string = "html hell ";
preg_match_all("/</",$string,$matches);
print_r($matches);
?>
输出结果:Array ( [0] => Array ( [0] => < ) )