Back to Tools
JSON to PHP Array
JSON to PHP Array
Convert JSON strings into PHP array syntax (associative or indexed)
PHP Tool
PHP Array Output
About the JSON to PHP Array
Convert JSON into a PHP array.
How to use the JSON to PHP Array
- Paste your code into the input box, or click Load Sample to load an example.
- Press Convert to PHP Array.
- Use Copy (or Download where shown) to keep the result. Clear empties the box.
Worked example
{"status":"success","data":[1,2,3]} becomes ['status' => 'success', 'data' => [1, 2, 3]].
Tips
- Objects become associative arrays and lists become indexed arrays.
Frequently Asked Questions
Yes. Use the PHP Array to JSON tool.