Question subject: php code to get yahoo stock data
Posted: Tue Nov 03, 2009 7:53 pm
Joined: Tue Nov 03, 2009 7:48 pm Posts: 1 Has thanked: 0 time Have thanks: 0 time
hi
i have write a php code to get yahoo stock data , when i fetch the web data it saves the data as text file in to host server local drive (c:\ ), but i want to save the yahoo stock data from any remote pc from where i browse the page and it saves the data as text file automatically in local pc's c drive . is there any way to do this , please help........... here is the code
Code:
$quotes =array('DOW','SPX','GOLD','OIL','AIG','APPLE','AMGN','BAC','DISH', 'DO','DIRECTV','FEDEX','GOOG','HD','IBM','INTEL','IP','COLA','LOWES', 'YEN','EUR','HK','JAP','AUS','INDIA'); //here you can out symbols of stock data $args = implode('&s=', $quotes); //$file = fopen("http://finance.yahoo.com/d/quotes.csv?s=$args&f=slp11d1t1c1ohgv&ej3j1x=.csv", "rb"); $file = fopen ("http://finance.yahoo.com/d/quotes.csv?s=$args&f=noc1&ex=.csv","r"); $data = array(); $table ='';
if ($file){ while($stocks = fgetcsv($file)){ $data[$stocks[0]]= $stocks; } fclose($file); }