Re: Str_Replace Command
| From: | Jason Wong | Date: | Mon, 02 Feb 2004 17:28:35 +0000 |
| Subject: | Re: Str_Replace Command | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-176587@lists.php.net to get a copy of this message | ||
On Tuesday 03 February 2004 01:09, Christopher J. Crane wrote:
> Well this is it and it is really got me...
> Echoing out the $Symbol and $Price works just fine one row about the
> $TickerData array assignment. Yet it outputs nothing.
> "Array ( [] => )" is what I get. If I change the line to
> $TickerData = array ("$Symbol" => "$Price"); I get nothing, or the same
> result. If I change the line to
> $TickerData = array ('$Symbo'l => '$Price'); I get the following
> Array ( [$Symbol] => $Price ) which tells me the assignment works, but it
> seems like the $Symbol and $Price variable are blank when assigning to the
> array. I know that they are not blank since they echoed out just fine one
> line above.....<GRRRRRR>
Are you sure that the line: echo $Symbol ...
is displaying something sensible for each $Row?
You're overwriting $TickerData at each iteration of the foreach-loop thus if
your last $Row doesn't contain something sensible neither would $TickerData.
You probably want to use this assignment instead:
$TickerData[$Symbol] = $Price;
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
TANSTAAFL
*/