这是要把这里面的win的值连接字符串赋值给$a 还是随便找一个进行赋值???
假设你给的素组赋值给$arr;
你要是随便找一个$last = end($arr);$a = $last['win']; 或者 $last = first($arr);$a = $last['win'];
循环也可以
这样的到的结果就是最后一个元素的win的值赋值给$a
foreach($arr as $v){
$a = $v['win'];
}
这样的到的结果就是将所有的win的值拼接赋值给$a
foreach($arr as $v){
$a .= $v['win'].',';
}
$b=Array
(
'0' => Array
(
'id' => "25",
'uid'=> "1",
'time' => "2017-06-03 00:00:00",
'locat' =>"包间",
'number' => "1",
'wid' => "1"
)
,
'1' => Array
(
'id' => "28",
'uid' => "1",
'time' => "2017-06-02 12:00:00",
'locat' => "包间",
'number' => "1",
'wid' => "1"
)
);
//$c=$b['1'];
$a=$b['1']['wid'];
echo $a;
?>
楼主自己看吧,你的数组赋值都有点问题