Arty Ziff Posted March 30, 2011 Share Posted March 30, 2011 When I use DOM to extract content from HTML text files, I get "funny characters" âsomethingââsomethingââWhen I look at the source, there is just white space. $dom = new DOMDocument(); $dom->preserveWhiteSpace = false; $dom->loadHTML($tblock[$i]); $xpath = new DOMXPath($dom); $tags = $xpath->query('//div[@class="desc"]/h2[@class="name"]'); foreach ($tags as $tag) { $tname[$i] = trim($tag->nodeValue); echo $tname[$i]."<br>"; } How can I strip out those invisible special chars? Link to comment https://forums.phpfreaks.com/topic/232139-stripping-special-char/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.