php array question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I have a line of php that I don't really understand.

foreach($this->orders as $OrderID => $value) {
    echo $OrderID."<BR>";
    $OrderObject =$this->orders[$OrderID=>$value];
    echo $OrderObject->OrderID."<--all the same<BR>";
}

I know that $this->orders is an array of "order" objects.

the result i get from this is:

line1. 388<--OrderID.
line2. 389<--all the same
line3. 389<--OrderID.
line4. 389<--all the same

I'm really confused about why line 1 and line 3 have different OrderID, but
line 2 and 4 have the same... I've been trying to fix this bug for 3 hrs
with no luck.
Any help would be really appreciated..

Thanks a lot

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux