Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?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));
Copy Clear