Development

PHP Array to JSON Converter

Convert simple PHP array structures to JSON examples or create PHP array code from JSON. Processing happens locally in the browser and no PHP code is executed.

Input and options

The parser intentionally supports only simple safe structures: arrays, strings, numbers, booleans, null, nested arrays and => keys.

What does the converter support?

PHP → JSON

Supported input includes simple array structures with [] or array(), => keys, strings, numbers, true, false and null.

JSON → PHP

Valid JSON is converted into PHP array syntax. Objects become associative arrays and JSON arrays become numeric arrays.

Intentionally limited

Constants, function calls, variables, classes, special comment logic and PHP expressions are not executed. This is intentional and keeps the tool safer for examples.