hey, guys, why does this code keep output ArrayArrayArray instead of Dec 28 for $data[0], , Dec 27 for $data[7] and so on. i would like to output all the date get from that URL, but my code failed.

<?php

	$data = array();
	require_once("simple_html_dom.php");
	$html=file_get_html("http://finance.yahoo.com/q/hp?s=4707.KL+Historical+Prices");
	foreach($html->find('td[class=yfnc_tabledata1]') as $e)
	{	$e->innertext;
    	        $data[] = array($e);
	        }
	echo $data[0];
	echo $data[7];
	echo $data[14];
        // you can output the value of $e using echo $e->innertext inside foreach loop 
?>

$data is multi-dimensional array..
try to print like this:

print_r($data[0]);
print_r($data[7]);

Because in line 8 you are casting $e as an array.

Member Avatar for diafol

As mentioned, you made $e an array , try:

$data[] = $e;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.