I am trying to export the results from querying "http://ichart.yahoo.com/table.csv?s=GOOG&a=0&b=1&c=2000&d=0&e=31&f=2010&g=w&ignore=.csv" with PHP and cURL.
I am using the following piece of code:
<?php
$curl=curl_init();
curl_setopt ($curl,CURLOPT_URL,"http://ichart.yahoo.com/table.csv?s=GOOG&a=0&b=1& c=2000&d=0&e=31&f=2010&g=w&ignore=.csv");
curl_setopt ($curl,CURLOPT_HEADER,0);
ob_start();
curl_exec ($curl);
curl_close ($curl);
$data=ob_get_clean();
$data=explode(",",$data);
$data=str_replace('"','',$data);
foreach ($data as $results)
{
echo "<td>$results</td>";
}
?>
How can show the results in Table format just like they appear in "http://ichart.yahoo.com/table.csv?s=GOOG&a=0&b=1&c=2000&d=0&e=31&f=2010&g=w&ignore=.csv" ??
I doing something wrong in echo ... but I am not sure how to do it.
Yours