Re: Forms and Arrays

From: Date: Fri, 28 Nov 2003 19:35:37 +0000
Subject: Re: Forms and Arrays
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-171300@lists.php.net to get a copy of this message
Dave - ..and then Dave Carrera said... % % Thank you for clearing up my rather lame explanation. % % So how can I process $_POST[dynamic-name][user-entered-value] arrays to give % me my desired output: % % fname0 = value flab0 = value fplc0 = value Do you really want a variable called $fname0 and another $fname1 and so on, or do you just want this output? It seems to me that you probably want the latter, so you need only walk through your array: foreach ( array_keys($_POST[fname]) as $k ) { print "fname$k = {$_POST[fname][$k]} " ; print "flab$k = {$_POST[flab][$k]} " ; print "fplc$k = {$_POST[fplc][$k]}<br>\n" ; } HTH & HAND :-D -- David T-G * There is too much animal courage in (play) davidtg@justpickone.org * society and not sufficient moral courage. (work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

« previous php.general (#171300) next »