<?php
include 'simple_html_dom.php';
$url = '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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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