开发者

2 values in array, coding [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarify开发者_高级运维ing this question so that it can be reopened, visit the help center. Closed 11 years ago.

Like you can do:

$array = array("stuff" => $stuff);

Cant you do:

$array = array();

$array[] = "stuff" => $stuff;

How can I do something like that?


No, but you can do:

$array["stuff"] = $stuff;


What's wrong with:

$array = array( 'stuff' => $stuff );

or

$array            = array();
$array[ 'stuff' ] = $stuff;


You can define the key inside the [].

$array["stuff"] = $stuff;


Try $array["stuff"]=$stuff should work.


$array['stuff'] = $stuff;

is correct one

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜