php - How to find for a string in html code -
i trying find string html section
example
<div class="container" data-id="youtube" style="height:100%;width:100%;border:none;"> <div class="inner"></div>
generally find string using
if(strpos($string,"youtube") !== false)
but sample test trying store html code php variable
$string="<div class="container" data-id="youtube" style="height:100%;width:100%;border:none;"> <div class="inner"></div>";
when try find youtube in $string , returns false(does not exist)
can me find string in html code thank you
i made simple test you....it's working on localhost:
<?php $string="<div class='container' data-id='youtube' style='height:100%;width:100%;border:none;'><div class='inner'></div>"; $search = "youtube"; if(strpos($string, $search) !== false) { echo "found"; } else { echo "not found"; } ?>
Comments
Post a Comment