Cannot use object of type stdClass as array? September 9, 2022 by Tarik Use the second parameter of json_decode to make it return an array: $result = json_decode($data, true);