PHP Class org\Transform

Mostra file Open project: top-think/thinkphp-extend Class Usage Examples

Public Methods

Method Description
__callStatic ( $method, $params ) Transform::jsonDecode('abc', true);
decode ( string $content, string $type, boolean $assoc = true, array $config = [] ) : mixed 解码数据
encode ( mixed $content, string $type, array $config = [] ) : string 编码内容

Private Methods

Method Description
init ( string $type ) 初始化解析驱动

Method Details

__callStatic() public static method

Transform::jsonDecode('abc', true);
public static __callStatic ( $method, $params )

decode() public static method

解码数据
public static decode ( string $content, string $type, boolean $assoc = true, array $config = [] ) : mixed
$content string 要解码的数据
$type string 数据类型
$assoc boolean 是否返回数组
$config array XML配置参数,JSON格式解码无此参数
return mixed 解码后的数据

encode() public static method

编码内容
public static encode ( mixed $content, string $type, array $config = [] ) : string
$content mixed 要编码的数据
$type string 数据类型
$config array XML配置参数,JSON格式生成无此参数
return string 编码后的数据