Zaxnyd Posted June 26, 2006 Share Posted June 26, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/12962-associative-array_push/ Share on other sites More sharing options...
adamwhiles Posted June 26, 2006 Share Posted June 26, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/12962-associative-array_push/#findComment-49840 Share on other sites More sharing options...
Zaxnyd Posted June 26, 2006 Author Share Posted June 26, 2006 Sadly, it does not. Quote Link to comment https://forums.phpfreaks.com/topic/12962-associative-array_push/#findComment-49844 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.