这个问题很简单,你给分也太高了
<?php
$s = "<!-- asdf(任意字符) -->
<a href=xxx.xxx>xxx</a>
<font color=red>ppppp</font>
<!-- asdf(任意字符1) -->
";
preg_match_all("/<!\-\- (.*) \-\->/",$s,$regs);
print_r($regs[1]);
?>
<?php
$s = "<!-- asdf(任意字符) -->
<a href=xxx.xxx>xxx</a>
<font color=red>ppppp</font>
<!-- asdf(任意字符1) -->
";
preg_match_all("/<!\-\- (.*) \-\->/",$s,$regs);
print_r($regs[1]);
?>
$s = "
<!-- asdf(任意字符) -->
";
preg_match_all("/<!\-\- (.*) \-\->/",$s,$regs);
$content = $regs[1][0];
print($content);
?>
意字符)
dsfssdas
(任意字符)
-->";
preg_match_all("/<!\-\-\s*?(.*)\s*?\-\->/s", $str, $result);
echo "<xmp>";
print_r($result[1]);
echo "</xmp>";
echo $result[1][0];
$str = "<!--asdf(任
意字符)
dsfssdas
(任意字符)
-->
<!--asdf(任意字符)dsfssdas(任意字符)-->";
preg_match_all("/<!\-\-\s*?(.*)\s*?\-\->/sU", $str, $result);
echo "<xmp>";
print_r($result[1]);
echo "</xmp>";
echo $result[1][0] . "<br />";
echo $result[1][1] . "<br />";
?>
$str = 'dfsdfdsf</script>';
$patterns = "/.*\<\/[script]*\>$/";
print preg_replace($patterns, '', $str);
//print 'skfshksdhf';
?>