baaingSheep

mixed json_decode ( string $json [, bool $assoc = false [, int $depth = 512 [, int $options = 0]]] )

 

当第二个参数为TRUE时  返回一个数组 

否则返回类

<php?
// 返回stdClass类    
$jsonClass = json_decode($json);
$element1 = $jsonData->element1;
$element2 = $jsonData->element2;


// 返回一个数组
$jsonArray = json_decode($json);
$element01 = $jsonData[\'element1\'];
$element02 = $jsobData[\'element2\'];

?>

 stdClass 由命名来看比较像是一个所有类的基类

分类:

技术点:

相关文章:

  • 2021-11-23
  • 2021-11-27
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2021-12-25
猜你喜欢
  • 2022-03-09
  • 2022-01-17
  • 2022-01-18
  • 2022-01-05
  • 2021-06-27
  • 2022-01-09
相关资源
相似解决方案