This is how you could retrieve data and parse it:
$sourceURL = 'http://finance.yahoo.com/d/quotes.csv?s=AAPL&f=snd1lyr';
$sourceData = file_get_contents( $sourceURL );
// separate into lines
$sourceLines = str_getcsv($sourceData, "
");
foreach( $sourceLines as $line ) {
$contents = str_getcsv( $line );
// Now, is an array of the comma-separated contents of a line
}
Update:
Yahoo provides historial data e.g. for AAPL on this page:
http://de.finance.yahoo.com/q/hp?s=AAPL
At the bottom of the page, you may download the table using this link:
http://ichart.finance.yahoo.com/table.csv?s=AAPL&d=3&e=22&f=2011&g=d&a=8&b=7&c=1984&ignore=.csv
I'd propose to play with the webpage to learn which parameters represent what.