Re: detecting HTML tags

From: Date: Tue, 15 May 2001 16:33:09 +0000
Subject: Re: detecting HTML tags
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-52888@lists.php.net to get a copy of this message
Yes, I thought similarly. But so far, neither works. $string="blah x<4 blah"; if (strlen($string) != strlen(strip_tags($string))){ echo "html"; } else { echo "text"; } The above still echos "html". kind regards, bill Jack Dempsey wrote: > $text = " 50 < 100 + 240"; > not html... > > would want regex's i would think, or the striptags version someone sent > before... > > -jack > > Christian Reiniger wrote: > > > > On Tuesday 15 May 2001 16:39, bill wrote: > > > Is there a way to detect the presence of HTML tags? > > > > > > I don't want them stripped out, I just want to know if a string > > > contains them. > > > > > > I'm rolling my own mailing program and want it to detect the HTML if > > > present and send it appropriately. > > > > if (strstr ($text, '<')) { > > UseHTML ($text); > > } else { > > UsePlaintext ($text); > > } > > > > -- > > Christian Reiniger > > LGDC Webmaster (http://sunsite.dk/lgdc/) > > > > The most exciting phrase to hear in science, the one that heralds new > > discoveries, is not "Eureka", but "That's funny..." > > > > - Isaac Asimov > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#52888) next »