Page 1 of 1

push both key and value onto an array

Posted: Wed Jul 21, 2004 6:05 am
by tores
Hi

I know it's possible to push a value onto an existing array, with array_push. But then the keys are set automatically. I want to push the value for the key also. Anyone know if, and how, this can be done?

Regards tores

Posted: Wed Jul 21, 2004 6:09 am
by feyd

Code: Select all

$arr[$key] = $value;