Error “Cannot use object of type stdClass as array” June 16, 2023 by Tarik Use the second parameter of json_decode to make it return an array: $result = json_decode($data, true);