<?
$string = "<font color=red>你好,php</font>";
echo preg_replace("/<font color=red>(.*)<\/font>/is", "\\1", $string);
?>
$string = "<font color=red>你好,php</font>";
echo preg_replace("/<font color=red>(.*)<\/font>/is", "\\1", $string);
?>
但楼上的没理解我真正的意思
我只是单纯的举了一个例子
要是$string中有几百几千个不同的html标签,还能像你这么做吗?
我要的是批量替换
去掉字符串中所有HTML标记
$str = <<< HTML
<font color=red>你好,php</font>
HTML;
echo strip_tags($str);
?>