Re: Very Odd Session Array Problem

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

 



I understand the recursion part, but i dont understand why this fixes it:

$quoteString = implode(",",$_SESSION['quotes'][$key]);
$_SESSION['quotes'][$key] = explode(",",$quoteString);

That is essentially just reading the values out, and sticking them back in.

Jason Barnett wrote:

> If i dont do that, when i do a print_r($_SESSION['quotes'][$key]) i get

errors that say RECURSION and its almost like the arrays are making new


If you have a SESSION['quotes'] array... and one of the elements in the array references the same SESSION['quotes'] array... then you are going to have recursion. It's not exactly an error, but it *is* a recursive array that never ends because it keeps pointing to itself. Hopefully this makes sense?


-- Aaron Axelsen lists@xxxxxxxxxxxx

Great hosting, low prices.  Modevia Web Services LLC -- http://www.modevia.com


-- 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