note 1241 deleted from Variables from outside PHP by ronabop

From: Date: Fri, 25 Aug 2000 08:24:01 +0000
Subject: note 1241 deleted from Variables from outside PHP by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-3129@lists.php.net to get a copy of this message
further on assigning array through form submition (&lt;input name="foobar[]"&gt;) here's the code again (with &amp;lt; and &amp;gt; placed in the code... sorry) first form creation code <pre> for ($i=0;$i&lt;5;$i++) { for ($r=0;$r&lt;5;$r++) { echo "&lt;input type=hidden name="foobar[$i][$r]" value="$i|$r"&gt;n"; } } </pre> first form proccessing code <pre> for ($i=0;$i&lt;5;$i++) { for ($r=0;$r&lt;5;$r++) { echo $foobar[$i][$r] . " - "; } } </pre> result<br> - - - - (....etc)<br> second form creation code <pre> for ($i=0;$i&lt;5;$i++) { for ($r=0;$r&lt;5;$r++) { echo "&lt;input type=hidden name="foobar<b>$i[$r]</b>" value="$i|$r"&gt;n"; } } </pre> second form proccesing code <pre> for ($i=0;$i&lt;5;$i++) { $myFoob = "foobar" . $i; for ($r=0;$r&lt;5;$r++) { echo ${$myFoob}[$r] . " - "; } } </pre> result:<br> 0|0 - 0|1 - 0|2 .... - 4|3 - 4|4 -

« previous php.notes (#3129) next »