Curly braces in string in PHP

后端 未结 5 794
刺人心
刺人心 2020-11-21 23:13

What is the meaning of { } (curly braces) in string literals in PHP?

5条回答
  •  南旧
    南旧 (楼主)
    2020-11-21 23:57

    As for me, curly braces serve as a substitution for concatenation, they are quicker to type and code looks cleaner. Remember to use double quotes (" ") as their content is parsed by PHP, because in single quotes (' ') you'll get the literal name of variable provided:

    
    

提交回复
热议问题