Michan Posted December 11, 2007 Share Posted December 11, 2007 Hi everyone, For some reason I am having problems inserting a new key/value into an existing array using array_push(). $i1 = array('number1' => 'Hello!'); array_push($i1, 'number2' => 'Hmm.'); Parse error: syntax error, unexpected T_DOUBLE_ARROW on line 5 What's going on here? Many thanks in advance. - Mi Quote Link to comment Share on other sites More sharing options...
tapos Posted December 11, 2007 Share Posted December 11, 2007 Try this instead of array_push() function $i1 = array('number1' => 'Hello!'); $i1['number2'] = 'Hmm.'; Quote Link to comment Share on other sites More sharing options...
Michan Posted December 11, 2007 Author Share Posted December 11, 2007 Great idea; can't believe this didn't cross my mind! Thanks Quote Link to comment 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.