Hi. I have been working on this non stop. I am trying to do a simple task of just reading a file into a variable. Somehow it isnt working. here is my code.
<?php $Symbol='qqq'; $url = "http://finance.yahoo.com/d/quotes.csv?s=$Symbol&f=st5l9c6p4b1a3"; //echo $url; //if(file_get_contents("http://finance.yahoo.com/d/quotes.csv?s=$Symbol&f=st5l9c6p4b1a3")){ if( fopen("$url", "r")){ echo "file works"; }else{ echo "LIFE SUCKS!!"; } $readl= implode(file("http://finance.yahoo.com/d/quotes.csv?s=$Symbol&f=st5l9c6p4b1a3")); echo $readl; for ($i=0;$i<8;$i++) { $read = str_replace(""", "", $readl[$i]); $read = explode(",", $read); $Symbol=$read[0]; $LastPrice=$read[2]; $Change=$read[3]; $ChangePercent=$read[4]; } ?><?=$Symbol?><?=$LastPrice?>–<?=$Change?>–<?=$ChangePercent?>
If you could help me out that would be great. THANKS