php xml字符串转化为 array数组的代码

来源:互联网 发布:求最简形矩阵 编辑:程序博客网 时间:2024/06/08 00:36
    /**     * XML转数组     * @param string $xmlstring XML字符串     *     * @return array XML数组     */    public static function toArray($xmlstring)    {        $object = simplexml_load_string($xmlstring, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);                return @json_decode(@json_encode($object),1);    }

0 0
原创粉丝点击