Skip to content
Advertisement

array_push is replacing the variables instead of adding them to the end

JavaScript

Does anyone see an issue? Array push is just replacing variables instead of adding them. The variables of $fname, $lname, and $gender are defined by the user in a form. I want the variables to simply be added to the end of the array instead of being replaced. Any responses are appreciated.

Advertisement

Answer

if $info["First_Names"] ,$info["Last_Names"] ,$info["Gender"] are arrays ,I don’t see any problem .

JavaScript

Outputs :

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement