相关疑难解决方法(0)

Reference — What does this symbol mean in PHP?

What is this?

This is a collection of questions that come up every now and then about syntax in PHP. This is also a Community Wiki, so everyone is invited to participate in maintaining this list.

Why is this?

It used to be hard to find questions about operators and other syntax tokens.¹
The main idea is to have links to existing questions on Stack Overflow, so it's easier for us to reference them, not to copy over content from …

php arguments symbols operators

4314
推荐指数
21
解决办法
63万
查看次数

Php array_push()vs myArray []

如果我理解正确,您可以使用以下方法为数组添加值:

$myArray[] = 123;
Run Code Online (Sandbox Code Playgroud)

要么

array_push($myArray, 123);
Run Code Online (Sandbox Code Playgroud)

一个更清洁/更快,然后另一个?

php arrays optimization

23
推荐指数
0
解决办法
5432
查看次数

PHP数组......空括号的含义是什么?

我遇到了一些看起来像这样的示例代码:

$form['#submit'][] = 'annotate_admin_settings_submit';
Run Code Online (Sandbox Code Playgroud)

为什么在['#submit']之后有一个空格,里面什么都没有?这意味着什么?谁能举个例子?通常(根据我的理解,可能是错误的)是数组有键,在这种情况下,$ form数组键'#submit'等于'annotate_admin_settings_submit'但是第二组括号的处理是什么.我见过一个数组看起来像的例子:

$form['actions']['#type'] = 'actions';

我知道这是关于php的一个非常基本的问题,但我在学习Drupal时遇到了这个问题,所以希望Drupal社区中的某个人可以澄清这个我正在痴迷的问题.

php arrays drupal drupal-7

4
推荐指数
2
解决办法
2782
查看次数

标签 统计

php ×3

arrays ×2

arguments ×1

drupal ×1

drupal-7 ×1

operators ×1

optimization ×1

symbols ×1