<?php json_decode( string $json, ?bool $associative = null, int $depth = 512, int $flags = 0): mixed
<?php public static function ifJsonToArray(mixed $data): string|object|array { if (is_string($data)) { $array = json_decode($data, true); $data = is_array($array) ? $array : $data; } return $data;