how do I filter special charactors while pursing??

Posted by mathew on Stack Overflow See other posts from Stack Overflow or by mathew
Published on 2011-01-09T01:31:34Z Indexed on 2011/01/09 1:53 UTC
Read the original article Hit count: 523

Filed under:
|

hi I am doing html pursing with php dom document I am getting some special charators in my result how do I filter the same??

foreach ($fdats as $fdat)
{
    foreach($fdat->getElementsByTagName('a') as $mdat)
    {
                $comb[] = trim($mdat->nodeValue);
    }

}

and the HTML is something like this

<div class="content1" id="user" style="width: 47%; margin-right: 20px;">
<div class="ad  first_row">
<p class="ad" style="width: 70%;">
<a href="/site/users"><img class="dynamic-icon">&nbsp; James</a>
</p>

the out put is  James, and how do I get rid of Â

© Stack Overflow or respective owner

Related posts about php

Related posts about php5