Home >Backend Development >PHP Tutorial > 正则去掉< ?>标签里的文字,该怎么处理

正则去掉< ?>标签里的文字,该怎么处理

WBOY
WBOYOriginal
2016-06-13 12:53:521064browse

正则去掉 ?>标签里的文字
curl解析某网站时,遇到一个BT的问题:某网站一段php代码由于没有使用完整的  被当做html源码给解析出来了。如何用正则去掉这段php标签里的文字?谢谢。

<div id="content"><br />
    some words<br />
</div><br />
<?	<br />
	$box_social['dimensioni']="80";<br />
        $box_vota=array();<br />
	$box_vota["novideo"]='';<br />
	$box_vota["nofoto"]='';<br />
	$box_vota["id_articolo"]='1003691';<br />
	include($_SERVER['DOCUMENT_ROOT']."/incs/box_social.php");	<br />
?><br />
<div id="footer"><br />
   some words<br />
</div>


------解决方案--------------------
preg_replace('//','',$html);
------解决方案--------------------
 '//msi'
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article: 洪量日志入库 Next article: redis的php客户端装配