我碰到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 SimpleXMLObject强制转换为数组.问题是每个子元素也是PHP SimpleXMLElement.
这可能吗?