How can I remove the (//<![CDATA[ , //]]>
) blocks; tags inside a script
element.
<script type="text/javascript">
//<![CDATA[
var l=new Array();
..........................
..........................
//]]>
</script>
Looks like it can be done with preg_replace()
but havent found a solution that works for me.
What regex would I use?
You don't need regex for a static string.
Replace those parts of the texts with nothing:
$string = str_replace("//<![CDATA[","",$string);
$string = str_replace("//]]>","",$string);