Jump to content

check whether a string contains HTML elements


arathi

Recommended Posts

you could compare the string with itself after tags have been removed if they are identical then no html is in teh string

 


if (strcmp($string, strip_tags($string)) == 0)
{
// no tags found
}
else
{
// tags found
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.