Arrays/variables don't write inside function?
I am having a bit of a brain freeze today. I am writing a function, and as part of the function, I want a counter to be incriminated, and a record added to my function. This should run after a form is submitted, so it checks how many name/email combos have been submitted, and ads them to the array accordingly.
The code I have, looks like this
$people = array();
$people[$name] = $email;
So if in the form, I enter a name into both name 1 and 2 fields, I'll get output like this:
It seems to not save the previous name, and just creates a new array with 1 user. The counter is also not incremented. How can I get my counter to show 2, and both of these gentlemen's names to be shown?
1Array ( [Dan Smith] => firstname.lastname@example.org )
1Array ( [Joe Blow] => email@example.com )