I am getting data froma website for stock information. If I type in the
brower the URL I get a text file display list this;
Now I want to break each line and then seperate each line by the commas. The
amount of linesin the file is never known so I assume I have to use
something like a foreach or while statement,but I am not sure the best way
to do it. This is what I have so far.
$Symbol = "IKN"; $LookupUrl =
"http://demos.inxdesign.com/download?sym=$Symbol&format=.txt"; $Results =
$Data = array(); split("\n", $Results) = array_push($Data, $line)
The end result I am trying to get is each line to be an element in an array.
Later I will go back and stepthrough each element of the array and then
split that by the commas and have it output into an HTML table.At least this
is the best way I can think to deal with it. I suppose a better way to do
this would be to make this an associative array and have the data of each
line be associated with the date then I could producea variable something
like $StockData[16-Jul-02][value], but I don't know how to do any of that.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php