Jump to content

[SOLVED] array_push not working...


gamesmstr

Recommended Posts

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

 

?

Link to comment
https://forums.phpfreaks.com/topic/173714-solved-array_push-not-working/
Share on other sites

Archived

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

×
×
  • Create New...

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.