Jump to content

Archived

This topic is now archived and is closed to further replies.

Zaxnyd

Associative "array_push()"

Recommended Posts

I need to push items and a reference key into an array, essentially an associative version of array_push(). I haven't been able to find a way to do this. If anyone could assist, I'd appreciate it. Thanks in advance.

Share this post


Link to post
Share on other sites
Not sure if this will work but its worth a shot

[code]
$stack = array("orange"=>23, "banana"=>65);
array_push($stack, "apple"=>43, "raspberry"=>64);
print_r($stack);
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.