View Single Post
Old 04-11-2004, 04:18 PM   #3
Jer
Green Mole
 
Join Date: Apr 2004
Posts: 4
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 !
Jer is offline   Reply With Quote