"PHP" PHP first day

Source: Internet
Author: User
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
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.