json_encode/json_decode - returns stdClass instead of Array in PHP

前端 未结 7 2205
太阳男子
太阳男子 2020-12-04 13:54

Observe this little script:

$array = array(\'stuff\' => \'things\');
print_r($array);
//prints - Array ( [stuff] => things )
$arrayEncoded = json_encod         


        
7条回答
  •  温柔的废话
    2020-12-04 14:36

    Take a closer look at the second parameter of json_decode($json, $assoc, $depth) at https://secure.php.net/json_decode

提交回复
热议问题