5) PHP, variable variable

Source: Internet
Author: User

The so-called mutable variable is the name of a variable and a variable.

The syntax for mutable variables is a very special syntax for PHP--rare in other languages.

1 $v 1 = "abc";          // This is a string variable whose content is the string "abc" 2 3 ten;             // This is an ordinary variable whose content is the number ten 4 5 Echo  $ $v 1;          // at this point, it's called "mutable variables."

How to Understand:

1, when the $ symbol appears, it is possible to understand that it is a variable

2, here the first "$" appears, then PHP interprets it as a variable, the variable name is $V1;

3, we have to know that the value of $v 1 is "abc",

4, then, the name of the variable after the first "$" symbol is given as "ABC"

5, that is: Echo is trying to output a variable $abc, which is naturally the number 10

1 In fact, in theory, variable variables can be nested more, such as: $$ $def;   

5) PHP, variable variable

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.