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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.