Re: Array Push and Keys

From: Date: Fri, 29 Aug 2003 15:38:47 +0000
Subject: Re: Array Push and Keys
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-161145@lists.php.net to get a copy of this message
Ford, Mike [LSS] wrote:
Having said that, I've just given you a clue: since array_push($array, $var) is equivalent to $array[] = $var, you can get the result you want by doing: $array[] = array($k, $v); (with, of course, appropriate values for $array, $k and $v substituted to suit your code!).
Shouldn't that be: $array[$k] = $v; -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.general (#161145) next »