这是我在PHP中收到它的多维关联javascript数组:
array (size=2)
0 =>
object(stdClass)[1]
public 'count' => string '30' (length=2)
public 'size' => string '1' (length=0)
public 'name' => string 'aa' (length=0)
public 'pid' => string '910' (length=0)
public 'price' => string '300' (length=0)
1 =>
object(stdClass)[2]
public 'count' => string '30' (length=2)
public 'size' => string '2' (length=0)
public 'name' => string 'bb' (length=0)
public 'pid' => string '920' (length=0)
public 'price' => string '400' (length=0)
如何在PHP中访问多维关联JS数组值?
答案 0 :(得分:2)
您必须将其用作对象,例如
foreach($array as $obj) echo $obj->count;