gamesmstr Posted September 9, 2009 Share Posted September 9, 2009 I can't for the life of me see what is wrong here.. Not doing anything hard, just adding values to the end of an array. Code: <?php $test=array("1","2","3"); echo sizeof($test) . "<br>"; $test=array_push($test,"4","5"); echo sizeof($test) . "<br>"; ?> This gives me: 3 1 Anyone have any idea why that isn't: 3 5 ? Quote Link to comment https://forums.phpfreaks.com/topic/173714-solved-array_push-not-working/ Share on other sites More sharing options...
Maq Posted September 9, 2009 Share Posted September 9, 2009 Don't redefine $test by assigning it to the array_push. Quote Link to comment https://forums.phpfreaks.com/topic/173714-solved-array_push-not-working/#findComment-915684 Share on other sites More sharing options...
gamesmstr Posted September 9, 2009 Author Share Posted September 9, 2009 DOH! Thanks. I knew it had to be something stupid... Quote Link to comment https://forums.phpfreaks.com/topic/173714-solved-array_push-not-working/#findComment-915687 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.