Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$json = '{"price": "40702810863010005000", "title": "40702810863010001312"}';
function jsonDecodeRecursive($data)
{
if (is_string($data)) {
$decoded = json_decode($data, true);
if (json_last_error() === JSON_ERROR_NONE) {
$data = $decoded;
}
}
if (is_array($data)) {
foreach ($data as $key => $value) {
$data[$key] = jsonDecodeRecursive($value);
}
}
return $data;
}
print_r(jsonDecodeRecursive($json, true));