Skip to content

Latest commit

 

History

History
92 lines (59 loc) · 1.79 KB

xml.rst

File metadata and controls

92 lines (59 loc) · 1.79 KB

XML 编码解码类

属性
命名空间 fize\crypt
类名 Xml
方法
方法名 说明
encode() 编码 XML 数据
decode() 解码 XML 数据

方法

encode()

编码 XML 数据

public static function encode (
    mixed $data,
    array $config = []
) : string
参数
名称 说明
data 被编码的数据
config 数据配置项
返回值

编码后的XML数据

decode()

解码 XML 数据

public static function decode (
    string $str,
    bool $assoc = true,
    array $config = []
) : \SimpleXMLElement|array
参数
名称 说明
str XML 字符串
assoc 是否转换为数组,默认为 true
config 数据配置项
返回值

解码后的 XML 数据