Json_decode and json_encode

$res = json_decode (json_encode ($res), true);

in the above code, encode is followed by decode, which is why

Php
Apr.24,2022

estimate that $res is an object before, convert the $res object to json data, then decode the json data and set the second parameter of json_decode to true to convert $res into an array. In short, turn the $res object into an array.

Menu