php simple dom parser returning "Array"
<?php
include 'simple_html_dom.php';
$ur开发者_StackOverflow中文版l = 'http://en.wikipedia.org/wiki/Myst';
$html = file_get_html($url);
echo $html->find('body');
?>
This has been returning "Array" on the browser when I try to ONLY get the contents of the body element
Yes, because there may be many elements that fit that selector, so an array of elements is returned. If you only want the first matching element, use $html->find('body', 0)
. This is all described in the manual: http://simplehtmldom.sourceforge.net/manual.htm
Maybe try
echo $html->find('body', 0);
精彩评论