- - Code, Content, and Presentation
- -- PHP Server Side Scripting
- ---- Array being reset rather than added to
Readie - 6:24 pm on Mar 2, 2013 (gmt 0)
I'm reading this as thinking every time the user submits this form, it adds to an array of previously submitted data?
In that case, you don't need to specify a specific key for your $other_array. You can use a variable key, or just let it decide on keys by itself:
// Let it decide it's own key.
// First submission has key 0
// Next has key 1 etc..
$other_array = $array;
// Or you can use something posted in the form
$other_array[$_GET['id']] = $array;
Also, hi Matt! :)
Thread source: http://www.webmasterworld.com/php/4550004.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com