简体   繁体   中英

How can i access to multidimensional associative JS array value in PHP?

this is my multidimensional associative javascript array that i have recieved it in PHP:

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)

How can i access to multidimensional associative JS array value in PHP ?

您必须将它用作对象,例如

foreach($array as $obj) echo $obj->count;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM