魔术引号如何访问包含“-”的数组元素名义上?
我正在阅读一本手册,发现一条声明说“如果数组元素与‘-’一起用作单词分隔符,则可以通过魔术引号访问数组的元素”..但没有提供任何解释。有人可以解释这背后的原因吗?
I was going through a manual and found a statement saying "if array element used with '-' as the word separator, the array's element can be accessed by magic quotes".. but didn't provided with any explanations on it. could some one explain the reason behind this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来就是这个(因为OP不会告诉我们):
http://www.dagbladet.no/development/phpcodingstandard/#arrayelement
这里“魔法引号”根本就是错误的名称。它们的意思是双引号字符串插值,具体来说:
与
实际上只有第一个是正确的语法。否则使用花括号和关键引号:
It's seemingly this one (since OP won't tell us):
http://www.dagbladet.no/development/phpcodingstandard/#arrayelement
Here "magic quotes" is simply the wrong designation. They mean double quoted string interpolation, specifically:
versus
And indeed only the first one is correct syntax. Else use curly braces and key quotes: