RE: [PHP] Referencing Multi Dimensional Arrays

From: Date: Thu, 02 Dec 2004 15:48:00 +0000
Subject: RE: [PHP] Referencing Multi Dimensional Arrays
Groups: php.general 
Request: Send a blank email to php-general+get-203358@lists.php.net to get a copy of this message
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 02 December 2004 15:17, Robinson, Matthew wrote: > Thanks for the help Mike, If I've got a reference to an > entry and say, > wanted to insert another entry, can I use array_push() with the > reference? Please keep discussions on list so that anyone reading this thread can follow it to its resolution -- plus which, someone else might still chip in with better ideas than me! The reference can be used interchangeably with the thing it's a reference to -- so if it's a reference to an individual element, no you can't use it with array_push() any more than you could, say, $arr['index']['array']['element']; but if the reference is to the parent array, then you could, just as you could with $arr['index']['array'] (if that all makes sense!). It might help you to read the manual section on references at http://www.php.net/manual/en/language.references.php. Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: m.ford@leedsmet.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

« previous php.general (#203358) next »