Convert JSON into a valid PHP array literal so you can drop API data or config straight into a PHP file. This tool parses your JSON and emits modern PHP short array syntax with square brackets, using numeric keys for arrays and string keys for objects. Strings are single quoted with backslashes and quotes escaped correctly, booleans become true and false, null stays null, and numbers pass through unchanged. Nested objects and arrays are indented so the result is easy to read and edit. It is exactly what you need when building a config array, a test fixture or a seed file from an existing JSON payload. Paste your JSON, click convert, and copy the PHP. Everything runs locally in your browser, so nothing you paste is ever sent to a server.
It emits a PHP array literal using the short bracket syntax, so objects and arrays become nested bracket arrays with key-value pairs.
JSON objects become associative arrays keyed by the original string keys, while JSON arrays become indexed arrays.
It is ready to drop into a PHP config, fixture or seed file where you want the data as a native array.
Convert JSON into a valid PHP array literal so you can drop API data or config straight into a PHP file. This tool parses your JSON and emits modern PHP short array syntax with square brackets, using numeric keys for arrays and string keys for objects.
Yes. JSON to PHP Array is completely free, with no sign-up and no usage limits.
Yes. JSON to PHP Array runs in any modern web browser. There is nothing to download or install.
Yes. JSON to PHP Array runs entirely on your device in your browser, so nothing you enter is uploaded to a server.
Link this tool from a README, doc or site. The badge links back to this page.
[](https://yourhack.ai/json-to-php-array)