Re: Re: does array_slice not work on multidimensional arrays?

From: Date: Sat, 08 Aug 2009 15:00:15 +0000
Subject: Re: Re: does array_slice not work on multidimensional arrays?
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-296476@lists.php.net to get a copy of this message
It seems clear to me, but do you also agree that my evidence is that array_slice() does NOT work on multi-dimmed arrays on v.4.3.9? Here is the evidence: this: var_dump($BuildPerUniqueDateArray); echo"\n\n~~~~~~~~~~~~~\n\n"; array_slice($BuildPerUniqueDateArray, 1, 2); var_dump($BuildPerUniqueDateArray);
It seems clear to me that you are dumping /the same/ array twice.
Aha. I see now. I had to *assign* the results of the array_slice to a [new] array and then use that ... (trying to do something and expecting the results to "stick" even without assigning them to a var, bites me every week or so. I'll get it through my old habits-from-other-languages skull eventually.) Thank you Nisse, -Govinda

« previous php.general (#296476) next »