THE PRACTICAL GUIDE · NORMANDIN SYSTEMS
Get more from Json to PHP-Array
Json to PHP-Array converts JSON to PHP array syntax. JSON objects map naturally to associative arrays, while JSON arrays map to ordered lists of values in PHP. JSON null and booleans must remain values rather than quoted text. Review numeric-looking keys because PHP key coercion can affect their identity. Distinguish a list from a keyed object, especially when numeric property names occur in the original JSON. Use the worked example to understand what a successful result looks like, then compare it with a small sample of your own input. Keep the original available until you have checked the output in its destination. Conversion establishes a representation; it does not establish that the underlying information is correct or that the receiving application accepts every supported feature.
Guide updated October 13, 2026
How to use this tool
- Enter or load JSON using the input controls. Begin with the worked example or a small sample for which you know the expected result.
- Review any available conversion options, then inspect the PHP array syntax result. Resolve a reported parse error at its source before attempting to reuse the output.
- Check the example below against your own data. Distinguish a list from a keyed object, especially when numeric property names occur in the original JSON.
- Copy or save the resulting PHP array syntax content using the controls provided, then validate it in the application or parser that will actually consume it.
SEE IT IN PRACTICE
A worked example
{"name":"Ada","active":true}["name" => "Ada", "active" => true] (equivalent PHP array)
The JSON property separator becomes the PHP key-value arrow, retaining a string and a boolean.
Review scalar values and numeric keys
JSON true, false, and null need to remain values rather than becoming the strings "true", "false", and "null". Numeric-looking property names need attention because PHP can coerce some array keys. Preserve a test case with leading-zero identifiers and nested arrays. When exact JSON shape matters, serialize the generated PHP value back through the application’s normal encoder and inspect the result.
Lists and associative arrays
A JSON array represents an ordered list; a JSON object represents named properties. PHP arrays can serve both roles, which can conceal a shape change during conversion. Test a list, an object with numeric-looking keys, and a nested object before using a generated fixture. The distinction becomes visible again when PHP serializes the value back to JSON, especially if integer keys are sparse or begin at a nonzero value.
When this tool is useful
- Prepare PHP fixtures from API examples while retaining a separate copy of the source.
- Use a small example to troubleshoot array nesting and key conversion and identify a representation mismatch.
- Create configuration array drafts without manually rewriting every field or symbol.
Tips for a better result
- JSON null and booleans must remain values rather than quoted text. Review numeric-looking keys because PHP key coercion can affect their identity.
- Distinguish a list from a keyed object, especially when numeric property names occur in the original JSON.
- After changing formats, compare meaningful values rather than whitespace alone. Read the PHP array syntax output with its intended parser when exact types or escaping matter.
Frequently asked questions
Why does PHP use an arrow for properties?
The => syntax associates a key with a value in an array expression.
Can numeric keys affect the result?
Yes. PHP key coercion and sparse integer keys can change how an array later serializes to JSON.
Are booleans supposed to be quoted?
Not when the source value is a JSON boolean. Quoting true or false turns it into text.
What happens to the information I enter?
The utility processes your input in this browser. Some tools retain field values in browser storage or the URL; avoid entering secrets in shareable fields. Page and asset requests still go to the hosting provider. Read the privacy and offline-use notes for details.