Note
Several ways to receive parameters in PHP
PHP5 receive parameters By default is required to use the
$_get[' value '];
$_post[' value '];
In the php.ini file, you can also
Turn register_globals = Off
Change register_globals = On
Can be used directly, the value of $value
===========================================
while (list ($name, $value) = each ($HTTP _post_vars)) {
echo "$name = $value
\ n ";
Each () is often used in conjunction with list () to iterate through an array, for example:
Example 2. Iterating through an array with each ()
$fruit = Array (' a ' = = ' Apple ', ' b ' = ' banana ', ' c ' = ' cranberry '); Reset ($fruit); while (list ($key, $val) = each ($fruit)) { echo "$key = $val \ n"; } /* Outputs:A = Apple b = Banana c = Cranberry */ ?> |
|
After each (), the array pointer stays in the next cell in the array, or when the end of the array is encountered, the last cell. If you want to iterate through the array again, you must use Reset ().
===========================================
PHP100 Chinese web: http://www.php100.com/
PHP10 Day Pass Video tutorial: http://www.php100.com/html/phpnews/PHPxinwen/2009/0408/14.html