本文介绍了 JSON
XML
YAML
相关函数。
JSON
json_encode()
将
数组
编码为json
1 | json_encode($value [, $options, $depth]); |
$options
中文 JSON_UNESCAPED_UNICODE
以字面编码多字节 Unicode 字符(默认是编码成 \uXXXX
)
json_decode()
将 json 解码为数组
1 | json_decode($json [, $assoc, $depth, $options]); |
XML
YAML
yaml 转数组 yaml_parse()
数组转 yaml yaml_emil()