Re: Explode Function - Delimiter issue?
Posted: Thu Oct 08, 2009 11:37 pm
Hi all,
I'm trying to use PHP to read this:
http://download.finance.yahoo.com/d/quo ... &f=nl1c1&e
The output is this:
"GEN ELECTRIC CO",16.22,+0.06
"Google Inc.",514.18,-3.36
I'm trying to use the explode function to seperate the top from bottom but it keeps bundling them together when I use this:
$csv = @file_get_contents($url);
$quote = explode("\r", $csv) ;
So if I echo $quote[0] it looks like this: "GEN ELECTRIC CO",16.22,+0.06 "Google Inc.",514.18,-3.36
In actual fact, I want
$quote[0] = "GEN ELECTRIC CO",16.22,+0.06
$quote[1] = "Google Inc.",514.18,-3.36
Thanks!
I'm trying to use PHP to read this:
http://download.finance.yahoo.com/d/quo ... &f=nl1c1&e
The output is this:
"GEN ELECTRIC CO",16.22,+0.06
"Google Inc.",514.18,-3.36
I'm trying to use the explode function to seperate the top from bottom but it keeps bundling them together when I use this:
$csv = @file_get_contents($url);
$quote = explode("\r", $csv) ;
So if I echo $quote[0] it looks like this: "GEN ELECTRIC CO",16.22,+0.06 "Google Inc.",514.18,-3.36
In actual fact, I want
$quote[0] = "GEN ELECTRIC CO",16.22,+0.06
$quote[1] = "Google Inc.",514.18,-3.36
Thanks!