Code Snippets Php

2 parts , first part is our form

Input your ticker symbol below





second part is yahoo2csv.php
//stock quote script
//this is the url for Microsoft's stock quote , we are opening it for reading
$fp = fopen ("http://finance.yahoo.com/d/quotes.csv?s=$request&f=sl1d1t1c1ohgv&e=.csv","r");
//this uses the fgetcsv function to store the quote info in the array $data
$data = fgetcsv ($fp, 1000, ",")
?>

















descriptionlatest figure
symbol
last price
date
time
change
open
high
low
volume

//close the filehandle $fp
fclose ($fp);
?>