note 32300 added to control-structures.foreach
| From: | coolmon at coolmon dot com | Date: | Fri, 23 May 2003 04:40:51 +0000 |
| Subject: | note 32300 added to control-structures.foreach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-48857@lists.php.net to get a copy of this message | ||
Ever wondered what variables you posted a php page with a form? If you remember, the $_POST and
$_GET variables are associative arrays.
Say you post variables:
email
name
and phone
In the page that recieves those variables from the posted form you can do this:
foreach($_POST as $varName => $value)
print "Variable: $varName Value: $value<br>\n";
It'll return:
Variable: email Value:<it's value>
Variable: name Value:<it's value>
Variable: phone Value:<it's value>
Hope this helps!
Coolmon (aka Jason)
----
Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32300
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32300&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32300&report=yes