Since I dont want to use stip_tags function of php instead of I want to replace <script> and </script>
to empty string so that output should be alert(1).
Input:-
<script>alert(1)</script>
Output:- alert(1)
how to achieve it.
Since I dont want to use stip_tags function of php instead of I want to replace <script> and </script>
to empty string so that output should be alert(1).
Input:-
<script>alert(1)</script>
Output:- alert(1)
how to achieve it.
You can always use strip_tags()
with a second parameter containing the allowable tags.
Alternativly, use...
preg_replace('/<script>(.*)</script>/i', '$1', $input);
Note, not tested.