i think my explanation was bad.
so i give you an example :
with the page html :
******************
<script></script>
some text, html code, a usually page in html ...
<script></script>
another part for text ...
<script></script>
******************
this operation :
eregi("<script[^>]*>(.*)</script>",$txt,$regs);
will fill the variable regs with :
***********************
print_r(regs):
array(
[0] => <script></script>
some text, html code, a usually page in html ...
<script></script>
another part for text ...
<script></script>
[1] => </script>
some text, html code, a usually page in html ...
<script></script>
another part for text ...
<script>
)
**********************
As you can see, the regs[1] contain all the html code ! so the clean function will just cut all the page if it contain a script tag at the beginning and at the end !
and javascript is pretty popular !
|