1. No matter what program, function name () {}, (){},.... This is too much, and I know what it is.
2. $ STR {4} after the variable of the string is the same as that of the variable of {}. The variable of the string is treated as an array.
Iii. {$ Val}. At this time, braces are used to tell PHP that the enclosed values should be processed as variables.
$ Arr = array (0 => 123, 'name' => 'pipig ');
Foreach ($ array as $ k => $ v ){
Echo "select * From blog_blogs where blog_tags like '% {$ arr [$ K]} % 'order by blog_id"; // Add a braces that will only be used as a variable identifier
}
Echo '<br/> ';
Foreach ($ array as $ k => $ v ){
Echo "select * From blog_blogs where blog_tags like '% {$ arr [$ K]} % 'order by blog_id"; // Add two braces, the outer layer is a common character.
}
// Use braces to differentiate Variables
// Echo "$ arr ['name']"; // a syntax error is returned when you use this sentence.
Echo "{$ arr ['name']}"; // This sentence is normal. The characters in braces are processed as variables.
// $ STR {4} after the variable of the string, the variable of the string is treated as an array like the braces ({}).
$ STR = 'abcdefg ';
Echo $ STR {4 };