note 23586 added to function.eval
| From: | arthur at do dot not dot spam dot batman dot is | Date: | Tue, 23 Jul 2002 09:36:01 +0000 |
| Subject: | note 23586 added to function.eval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33411@lists.php.net to get a copy of this message | ||
I used to use this p0 to p50 method myself, using eval or $$ to evaluate the results. Then I
realized that a set of form field with a common array name like p[] end up begin an array in php:
<form>
Field one: <input name="p[]">
Field two: <input name="p[]">
Field three: <input name="p[]">
</form>
...
<?
echo "Field one: $p[0]";
echo "Field two: $p[1]";
echo "Field three: $p[2]";
?>
This can be very useful, for example when using <select multiple> or a set of checkboxes.
--
http://www.php.net/manual/en/function.eval.php
http://master.php.net/manage/user-notes.php?action=edit+23586
http://master.php.net/manage/user-notes.php?action=delete+23586
http://master.php.net/manage/user-notes.php?action=reject+23586