array varible problems
| From: | edwardspl at ita dot org dot mo | Date: | Sat, 13 Aug 2005 12:35:41 +0000 |
| Subject: | array varible problems | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-220551@lists.php.net to get a copy of this message | ||
Dear you,
Now, I want to define a set of array varible with table structure as the
following:
Result page:
<table>
<tr>
<td><? $f1[0];?></td>
<td><? $f2[0];?></td>
<td><? $f3[0];?></td>
<td><? $f4[0];?></td>
</tr>
<tr>
<td><? $f1[1];?></td>
<td><? $f2[1];?></td>
<td><? $f3[1];?></td>
<td><? $f4[1];?></td>
</tr>
<tr>
<td><? $f1[2];?></td>
<td><? $f2[2];?></td>
<td><? $f3[2];?></td>
<td><? $f4[2];?></td>
</tr>
</table>
Source page:
<table>
<tr>
for($i=1;$i<5;$i++)
{
<td><input type=checkbox name='f<? echo $i;?>[]'
value='1'></td>
}
</tr>
</table>
Only display the result of zero array, eg :
f1[0]
f2[0]
f3[0]
f4[0]
So, how to write the source (Web page - when user click the submit
button) by using loop ?