PHP Learning Notes

Source: Internet
Author: User
  1. globalKeywords are used to access global variables within functions.
    PHP also stores all global variables in an array named $GLOBALS [index]. The subscript is the variable name.
    This array is also accessible within the function and can be used to update global variables directly.
  2. staticKeywords are used for situations where a local variable is not required to be deleted.

  3. echoand print the difference between:
    · Echo: Capable of outputting more than one string
    · Print: Only one string is output and always returns 1
    · Echo is slightly faster than print because it does not return any values.
  4. var_dump()Returns the data type and value of the variable

    $cars=array("Volvo","BMW","SAAB");echo "My car is a {$cars[0]}";var_dump($cars);array(3) { [0]=> string(5) "Volvo" [1]=> string(3) "BMW" [2]=> string(4) "SAAB" }

PHP Learning Notes

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.