innerHTML of each link not working
<p>I have the following code</p>

<pre><code>function DOMinnerHTML($element)
{
    $innerHTML="";
    $children=$element-&gt;childNodes;
    foreach($children as $child)
    {
        $tmp_dom=new DOMDocument();
        $tmp_dom-&gt;appendChild($tmp_dom-&gt;importNode($child,true));
        $innerHTML.=trim($tmp_dom-&gt;saveHTML());
    }
    return $innerHTML;
}

$doc=new DOMDocument();
$doc-&gt;loadHtmlFile('http://www.google.com/');
$links=$doc-&gt;getElementsByTagName('a');
foreach($links as $m)
{
    echo DOMinnerHTML($links[$m]).'&lt;br /&gt;';
}
</code></pre>

<p>And it outputs nothing.</p>

<p>How can I do so that it outputs the content of each link in all <code>http://google.com</code> ?</p>
