View Single Post
Old 11-13-2007, 07:05 AM   #2 (permalink)
Haris
The Frequenter
Prolific Welcomer Upcoming Programmer 
 
Join Date: Sep 2007
Posts: 360
Thanks: 24
Haris is on a distinguished road
Default

Quote:
Originally Posted by CMellor View Post
Hey, was fooling around with some array functions, and just wondered...

Ya know how array_push adds a new value to your array? Can it also add a key, because I tried:

PHP Code:
array_push($array'Chris' => 'Mellor'); 
but got an error.

I'm sure it's possible, anybody an idea?
http://php.net/array_push

Quote:
Note: If you use array_push() to add one element to the array it's better to use $array[] = because in that way there is no overhead of calling a function.
You can use $aArray['Chris'] = 'Mellor'; .
Haris is offline  
Reply With Quote