Re: Copying array segments

From: Date: Fri, 04 Oct 2002 23:53:31 +0000
Subject: Re: Copying array segments
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-118917@lists.php.net to get a copy of this message
> I've got an array that is 5 arrays deep, and I want to copy the array > three levels down of one index into a new array. > > Example: > $output['recommendernames'][0]['recommendername'][0]['com']; > > This is what I want to do: > > $newoutput = $output['recommendernames'][0]['recommendername']; > > So that newoutput is an array that is two arrays deep: > $newoutput[0]['com'] > > Is there a special function for this? None needed. You just did it. -Rasmus

« previous php.general (#118917) next »