I am working on a project and I am facing a problem that "span>" also prints in the start of text I tried to remove all the tags every thing gone finely except the one i mentioned above,
here is my php code
<p>
<?php
$desc = $top_news['headline_des'];
$aa = preg_replace( '/style=(["\'])[^\1]*?\1/i', '', $desc, 2 );
if(strlen($top_news['headline_des'])>100)
{
$description = substr($aa, 1 ,850)."...";
}else{
$description = $aa;
}
echo strip_tags($description);
?>
</p>
here is the output
span >IPOR have the International Republican Institute (IRI) and the United States Agency for International....