JSON to PHP Array
Convert JSON into a PHP array using short-array syntax — in your browser.
PHP array
$data = [
'name' => 'Ada',
'active' => true,
'roles' => [
'admin',
'editor',
],
'profile' => [
'age' => 36,
'city' => 'London',
],
];JSON to PHP arrays
This converts a JSON document into a PHP value using modern short-array syntax ([ ]): JSON objects become associative arrays ('key' => value) and JSON arrays become list arrays. It's handy for seeding config or fixtures from an API response. Parsing happens entirely in your browser.
Related: the JSON formatter, the JSON to TypeScript generator, and the JSON to YAML converter.
Related Converters tools
JSON to YAML
Convert JSON into clean, readable YAML instantly.
YAML to JSON
Convert YAML configuration into valid JSON.
JSON to CSV
Flatten a JSON array of objects into CSV rows.
CSV to JSON
Parse CSV with headers into a JSON array of objects.
JSON to XML
Convert JSON structures into nested XML markup.
JSON Minifier
Strip whitespace to produce compact JSON.
JSON to TypeScript
Generate TypeScript interfaces from a JSON sample.
JSON to SQL
Turn a JSON array of objects into SQL INSERT statements.