PHP/Drupal - 数组上的井号
嗨
当我打印出变量时,我在数组上得到了井号,如下所示:
...
[#weight] => 0
[#theme] => text_formatter_default
[#field_name] => field_product_item_no
[#type_name] => product
...
井号的含义是什么?
谢谢
Hi
When I print out the variable, I got pound sign on the array as below:
...
[#weight] => 0
[#theme] => text_formatter_default
[#field_name] => field_product_item_no
[#type_name] => product
...
What is the meaning of Pound sign?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这正是Drupal Forms API 期望其数据的方式。
This is just the way the Drupal Forms API expects its data.
在 Drupal 中,[#key] 的值是元数据,而 [key] 的值是数据。
根据 Drupal Stackexchange 上我关于“#”属性的问题的答案,
In Drupal, [#key]'s value is metadata, whereas [key]'s value is data.
According to the answer given to my question about "#" properties on the Drupal Stackexchange,
井号只是作为数组键的有效字符,除了应用程序定义的约定之外,在 PHP 中没有特殊含义。
The pound sign is just a valid character as array key and has no special meaning in PHP besides a convention defined by the application.