I have file which get content from my other site. It is clude lot of:
<script>
[random] string 1
</script>
<script>
[random] string 2
</script>
....
<script>
[random] string n
</script>
<script type="text/javascript">
must keeping script
</script>
<script type=text/javascript'>
must keeping script
</script>
I want to REMOVE <script>
and </script>
but KEEP content between them "[random] string ..." using PHP.
Note: str_replace can remove them but may make hurst other scripts <script type="text/javascript">must keeping</script>
and <script type='text/javascript'>must keeping</script>
.
It will lost close tag </script>
of must keeping script
Thanks for helping
//SOLVED with:
$content = preg_replace('/(<script>)(.*?)(<\/script>)/s', '$2', $content);
Anyway, thanks for helping