$info = array(
"First_Names" => "John",
"Last_Names" => "Smith",
"Gender" => "Male",
);
array_push($info["First_Names"], "$fname");
print_r ($info);
I started learning PHP through a high school class. I'm not exactly knowledgeable nor do I pay attention much, but I'm completely stuck on this;
What I'm trying to do is get the variable $fname which is defined by the user (Jack, James, Shelly, etc) to be pushed into the array First_Names which is inside the array of $info. I'm not sure where it's going wrong, but PHP is not declaring $info as an array (I think, it states "Warning: array_push() [function.array-push]: First argument should be an array in /home/a4938424/public_html/process.php on line 22". If I print out the array it will show up the default names and gender,and if I echo out the $fname variable it shows up properly.)
I've consulted two different people and neither of their suggestions worked, now I'm stumped completely and everyone is out of suggestions. Does anyone see what's going on with it? Thanks for any responses, please be aware that I barely know any PHP.