What is the meaning of braces {} in php. 1. {} indicates the start and end of the program block. for example, the code for copying code is as follows: if ($ x $ y) {do_nothing ();} 2. {} is used to indicate the string subscript. for example, $1 and {} are used to indicate the start and end of the program block.
For example
The code is as follows:
If ($ x = $ y)
{
Do_nothing ();
}
2. {} indicates the subscript of a string.
For example
(Reference longnetpro)
$ S {1} indicates the 2nd bytes (not the first) of the string $ s. It is basically equivalent to $ s [1], but the latter is the old one, PHP Manual recommends the first method: www.444p.com All rights reserved
3. separate variables
For example
The code is as follows:
$ S = "Di ,";
Echo ("$ {s} omething ");
// Output: Di, omething
If echo ("$ something") is used ");
Then the variable $ something is output.
Else {} indicates the start and end of the program block. for example, the code is as follows: if ($ x = $ y) {do_nothing ();} 2. {} indicates the string subscript. for example, if you reference the longnetpro brother, $...