<?php
$json = '{"a":1,"b":2,"c":3,"d":4,"e":5}';

var_dump(json_decode($json));
var_dump(json_decode($json, true));

?>

结果:

object(stdClass)[1]
  public 'a' => int 1
  public 'b' => int 2
  public 'c' => int 3
  public 'd' => int 4
  public 'e' => int 5

array (size=5)
  'a' => int 1
  'b' => int 2
  'c' => int 3
  'd' => int 4
  'e' => int 5

true返回值是数组,否则返回值为object

相关文章:

  • 2022-12-23
  • 2021-06-19
  • 2022-12-23
  • 2022-01-30
  • 2022-12-23
  • 2022-01-22
  • 2021-10-21
猜你喜欢
  • 2022-12-23
  • 2021-07-17
  • 2022-01-05
  • 2021-08-25
  • 2022-12-23
  • 2021-10-17
  • 2022-12-23
相关资源
相似解决方案