In php I have a basic array in 1 file that starts out empty:
$array= array();
I have that file included in the next file; in this file every time the page loads (because it’s a landing page for a form submission) I want to add a certain piece of the information submitted to the array
$array[]=$var;
And this works. However what I do not understand is when I echo the array to test it to see if it is holding the values, it is only holding the values for the current addition, it does not remember all the previous times the variable was added to the array. (I know you may think it will be long array but later on in the project I am going to remove/unset values from the array based on conditions but that’s not the point now) Why isn’t the array remembering al the values pushed into it?