A worked example, rendered from real sample data. Sign in to run the tool on your own input.
{"product":"Laptop","price":1299.99,"inStock":true,"specs":{"cpu":"M3","ram":16},"colors":["silver","space-gray"]}<?php
$data = [
'product' => 'Laptop',
'price' => 1299.99,
'inStock' => true,
'specs' => [
'cpu' => 'M3',
'ram' => 16
],
'colors' => [
'silver',
'space-gray'
]
];
Convert JSON to a PHP 5.4+ short-syntax associative array. Part of the DevTools Surf developer suite. Browse more tools in the Converters collection.