o.k
i have an html file that goes like this:
</html>
[/code]
using PHP i read through the file and store it in a single variable called $val.
i want to remove the <script> tags and their contents(ie function1 and 2).
i used the following:
$val1=eregi_replace("<script[^>]*>.*</script>","",$val);
the problem here is that it replaces from the first scrtip tag (ie function1) upto the last </script> tag ie function2. therefore the value in $val becomes:
</html>
[/code]
but i want:
</html>
[/code]
Note: I have found a roundabout for this. but i was just wondering why this peculiar behavior?
Known is handfull, Unknown is worldfull
i have an html file that goes like this:
Code:
<html>
<head>
<script>
//Function2
</script>
</head>
<body>
Hello how are you
<script>
//Function2
</script>
</body>
[/code]
using PHP i read through the file and store it in a single variable called $val.
i want to remove the <script> tags and their contents(ie function1 and 2).
i used the following:
$val1=eregi_replace("<script[^>]*>.*</script>","",$val);
the problem here is that it replaces from the first scrtip tag (ie function1) upto the last </script> tag ie function2. therefore the value in $val becomes:
Code:
<html>
<head>
</body>
[/code]
but i want:
Code:
<html>
<head>
<body>
Hello how are u
</body>
[/code]
Note: I have found a roundabout for this. but i was just wondering why this peculiar behavior?
Known is handfull, Unknown is worldfull