<?php
$mystring = "I said <ignore me then!>you <b>are a little bit</b> whack!";
echo strip_tags($mystring);
?>
I said you are a little bit whack!
Php'de bir string ifadenin html tagı içerip içermediğini nasıl anlarım?
<?php $isithtml = "I said <ignore me then!>you <b>are a little bit</b> whack!";$actual_length = strlen($isithtml);
$stripped_length = strlen(strip_tags($isithtml));
if($actual_length != $stripped_length) {
echo "The length has changed when we call strip tags, therefore the string does contain HTML";
}
else { echo "HTML? What HTML? None to be seen here!"; }
?>
The length has changed when we call strip tags, therefore the string does contain HTML