How can I check if PHP string contents contain any HTML contents?
I'm not good with Regular Expressions so I would like to have a function named "is_html" to check this. :) thank you!
is_html
If you want to test if a string contains a "<something>", (which is lazy but can work for you), you can try something like that :
"<something>"
function is_html($string) { return preg_match("/<[^<]+>/",$string,$m) != 0; }
1.4m articles
1.4m replys
5 comments
57.0k users