<snip>
  $StockURL =
"http://finance.yahoo.com/d/quotes.txt?s=xrx,ikn,danky&f=sl1&e=.txt";;
  $StockResults = implode('', file("$StockURL"));
  $Rows = split("\n", $StockResults);
  foreach($Rows as $Row) {
    list($Symbol, $Price) = split(",", $Row);
 $Symbol = str_replace('"', "", $Symbol);
    echo $Symbol." - ".$Price."<br>\n";
    $TickerData = array ($Symbol => $Price);
    }
  print_r($TickerData);
</snip>

why not replace:
$TickerData = array ($Symbol => $Price);

that line reassigns $TickerData to a array with one element in it
everytime you call it.  The last time through your loop, $Symbol = ''
and $Price = '', so you get Array ( [] => ) when you print_r

with this:
$TickerData[$Symbol] = $Price;

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

Reply via email to