>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 =
>implode('', file("$LookupUrl"));
> $Data = array(); split("\n", $Results) = array_push($Data, $line)

file() is already *GIVING* you an array of each line.

You simple need to look at each one and separate by commas.

$data = file($LookupUrl);
while(list(,$line) = each($data)){
  $values = explode(',', $line);

Like Music?  http://l-i-e.com/artists.htm

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to