Discover php curly braces variable, include the articles, news, trends, analysis and practical advice about php curly braces variable on alibabacloud.com
One, no matter what the program, function name () {}, for () {}, .... Too much, do not say also know what to do with.
Second, the $str {4} After the variable of the string followed by {} curly braces and brackets are the same as the string variable
One, no matter what the program, function name () {}, for () {}, .... Too much, do not say also know what to do with.
Two, $str {4} After the string's variable followed by {} braces and brackets are all treating a string variable as an array.
Three,
Transfer from http://www.cnblogs.com/jayleke/archive/2011/11/08/2241609.html1. Simple syntax rules (use curly braces to define variable names for all versions of PHP): $a = ' flower '; echo "She received some $as"; The letter S will be considered as
BracesMany languages use curly braces as scope boundaries, and only the curly braces of functions in PHP form a new scope.The operating result is:String (5) "Var a" string (5) "Var C" string (5) "Var B" string (5) "Var C"Visible if and for curly
The scope of a variable is a scope of the variable, in which the variable is visible, that is, the area of the code that can access the variable, and, conversely, if it is not within that scope, the variable is not visible and cannot be invoked.
PHP Summary
Summary of basic knowledge: a summary of single-quote double-quote curly braces in PHPIn PHP, strings can be represented by single quotes or double quotes, output, and so on.For example:
PHP code
Their output is the same. Will print
Use of braces (curly braces {}) in PHP
There are basically three cases of using braces in php. The following article summarizes these three cases.
I. function name () {}, for () {} and so on. I will not talk about this situation, but I also know
The role of PHP curly braces
When the PHP parser encounters a dollar ($) symbol, he will, like many other parsers, assemble as many tokens as possible to form a valid variable name.
You can use curly braces to define the bounds of a
This article mainly introduces the use of curly braces ' {} ' in PHP, summarizes and analyzes the usage techniques of the braces in PHP in terms of compound statements and variable definitions, in conjunction with the example form, and the need for
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.