php简单的html dom解析器如何获取html标签的内容

问题描述:

I am trying to get the specific tag content, but seems I am not able to do so using following function

<?PHP
include_once('simple_html_dom.php');

function read_page($url = 'http://google.com')
{
        $doc = new DOMDocument();

        $data = file_get_html($url);

        $content = $data->find('div#footer');

        print_r( $content);

}

read_page();
?>

Try $data->find('div[id="footer"]')