html - Get "Text-Only" Text With PHP Strip Tags -
i'm using php simple html dom parser. can use in solutions
okay. so, i'm loading file this:
$html = file_get_html('http://localhost/seo/testfile.php');
and echo code echo strip_tags($html);
so far, good.
the problem occours when user enter inline code like
<script>alert(1)</script>
so want not display present inside <script>, <style>,
etc. tags. how do that?
cheers!
i think php dom , can required html of element , indirectly of whole page. same below.
$dom = new domdocument(); libxml_use_internal_errors(true); $dom->loadhtml($content); $data = $dom->getelementsbytagname("tr"); foreach($data $value){ if($value->getattribute('class')== 'notesrow'){ $aa = $value->nodevalue; } }
Comments
Post a Comment