🔍

首页Home › 开发工具Developer Tools

🐘 JSON 转 PHP 数组JSON to PHP Array

把 JSON 转成 PHP 数组代码,支持短数组 [] 和 array() 两种写法、缩进设置,字符串自动转义,大整数保持原样不丢精度。Convert JSON into PHP array code in short [] or array() syntax with configurable indentation, escaped strings and big integers kept exactly.

使用说明与常见问题How-to & FAQ

「JSON 转 PHP 数组」是什么?What is the JSON to PHP Array tool?

把 JSON 转成 PHP 数组代码,支持短数组 [] 和 array() 两种写法、缩进设置,字符串自动转义,大整数保持原样不丢精度。Convert JSON into PHP array code in short [] or array() syntax with configurable indentation, escaped strings and big integers kept exactly.

如何使用「JSON 转 PHP 数组」?How do I use the JSON to PHP Array?

把 JSON 粘贴到输入框,选择数组写法和缩进,下方即生成 PHP 代码,可直接赋值给变量,例如 $data = [ 'name' => 'Alice' ];。Paste JSON, choose the array syntax and indentation, and PHP code appears below, ready to assign, e.g. $data = [ 'name' => 'Alice' ];.

JSON 对象和数组分别对应什么?How do JSON objects and arrays map to PHP?

JSON 对象变成关联数组('key' => value),JSON 数组变成索引数组;true/false/null 原样输出,像 "10" 这样的纯数字键会写成整数键,与 PHP 自身行为一致。JSON objects become associative arrays ('key' => value) and JSON arrays become indexed arrays; true/false/null are kept, and numeric-string keys like "10" are written as integer keys, as PHP itself does.

超大整数会丢精度吗?Do big integers lose precision?

不会。在支持的浏览器中工具会读取数字的原始文本,例如 12345678901234567890 会原样写入 PHP 代码(PHP 运行时超出 64 位的整数会被当作浮点数)。No. In supporting browsers the tool reads each number's original text, so 12345678901234567890 is written as-is (note PHP itself treats integers beyond 64 bits as floats).

「JSON 转 PHP 数组」免费吗?数据会上传吗?Is the JSON to PHP Array free? Is my data uploaded?

「JSON 转 PHP 数组」完全免费,无需注册或安装,手机和电脑都能用;所有处理都在你的浏览器本地完成,输入的内容和文件不会上传到服务器。The JSON to PHP Array is completely free with no sign-up or install and works on phones and desktops; everything runs locally in your browser and nothing you enter is uploaded.

相关工具Related tools

🧾 JSON 格式化校验JSON Formatter & Validator🐘 PHP 代码格式化PHP Code Formatter🐍 JSON 转 Python 字典/列表JSON to Python Dict Converter🗄️ JSON 转 SQLJSON to SQL Converter💠 JSON 转 C# 实体类JSON to C# Class🌲 JSON 可视化树形查看器JSON Tree Viewer📊 CSV JSON 互转CSV to JSON Converter🔀 YAML JSON 互转YAML to JSON Converter

← 全部工具All tools