Hello, all! I use strip_tags() PHP function for my search engine to exclude all HTML and PHP tags from file text. But! It does not exclude PHP tags. Why? May be, I write them incorrectly? I always do like this:
<?PHP
//code here
?>
Or why then? Appreciate your attention :-)
Why you don't use regexp? eg. <? $text="<p>paragraph</p> and <? phpinfo() ?>"; echo ereg_replace("<[<>]*>","",$text); ?>
Thanks a lot. And more question. Could you please explain me, what is: "<[<>]>" in echo ereg_replace("<[<>]>","",$text); Sorry, may be, this question looks stupid for you, but I really don't know what this synthax means.
<[<>]*> means:
match all the text beginning with <, ending with > and text inside must not contains < or > ...
eg: <font face="">text</font> - 1. match is <font..> - 2. match is </font>
and text remains