I am parse some html code with curl. some site’s html source like:
<div id="content">
some words
</div>
<?
$box_social['dimensioni']="80";
$box_vota=array();
$box_vota["novideo"]='';
$box_vota["nofoto"]='';
$box_vota["id_articolo"]='1003691';
include($_SERVER['DOCUMENT_ROOT']."/incs/box_social.php");
?>
<div id="footer">
some words
</div>
How to remove php short tags from html source? I need
<div id="content">
some words
</div>
<div id="footer">
some words
</div>
And I use preg_replace('/<\?(.*?)\?>/','',$html);, but the php short tag part still there.
This regex matches your case:
This also matches if more than one block of PHP is there:
FROM PHP.NET