PHP: How can I eliminate quotes around output from CSV file?
- by brian johnson
This code:
<?php $curl=curl_init();
curl_setopt ($curl,CURLOPT_URL,"http://download.finance.yahoo.com/d/quotes.csv?s=XIN&f=l1c1p2rj1y&e=.csv");
curl_setopt ($curl,CURLOPT_HEADER,0);
ob_start();
curl_exec ($curl);
curl_close ($curl);
$data=ob_get_clean();
$data = explode(",",$data);
foreach ($data as $results)
echo "<td>$results</td>";
?>
yields these results in my browser: 2.80 +0.02 "+0.72%" 1.85 204.2M 1.44
How can I have this PHP code above eliminate the quotations around the "+0.72%" so the end result is just: 0.72% ?