相关疑难解决方法(0)

将SimpleXML对象转换为数组

我碰到SimpleXML对象转换为阵列的这种功能在这里:

/**
 * function object2array - A simpler way to transform the result into an array 
 *   (requires json module).
 *
 * This function is part of the PHP manual.
 *
 * The PHP manual text and comments are covered by the Creative Commons 
 * Attribution 3.0 License, copyright (c) the PHP Documentation Group
 *
 * @author  Diego Araos, diego at klapmedia dot com
 * @date    2011-02-05 04:57 UTC
 * @link    http://www.php.net/manual/en/function.simplexml-load-string.php#102277
 * @license http://www.php.net/license/index.php#doc-lic
 * @license http://creativecommons.org/licenses/by/3.0/ …
Run Code Online (Sandbox Code Playgroud)

php xml arrays

66
推荐指数
2
解决办法
15万
查看次数

从SimpleXMLObject到Array的递归转换

我需要以递归方式将PHP SimpleXMLObject强制转换为数组.问题是每个子元素也是PHP SimpleXMLElement.

这可能吗?

php casting simplexml

22
推荐指数
2
解决办法
8578
查看次数

标签 统计

php ×2

arrays ×1

casting ×1

simplexml ×1

xml ×1