org\Transform::encode PHP Method

encode() public static method

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