Enter JSON on the left, get PHP array code on the right in real-time
Convert JSON to PHP Array: Enter valid JSON in the left editor. The corresponding PHP array code is generated in real-time on the right panel.
Type Mapping:
Default output uses PHP short array syntax [] (PHP 5.4+).
JSON is a lightweight data interchange format that uses text to represent structured data. PHP arrays are built-in data structures that can function as both indexed and associative arrays. This tool converts between them automatically.
Yes! The generated PHP array code is syntactically correct and ready to paste into your PHP project. Enable "Include variable declaration" to generate $data = [...] assignment statements.
Processing is done entirely in the browser, limited by memory. Most files up to a few MB work fine. For very large files, consider using a command-line script instead.