本文整理汇总了PHP中XML::toArray方法的典型用法代码示例。如果您正苦于以下问题:PHP XML::toArray方法的具体用法?PHP XML::toArray怎么用?PHP XML::toArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XML
的用法示例。
在下文中一共展示了XML::toArray方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: XML
/**
* Process XML Response
*
* Process the XML response from Twitter.com
*
* @param string $response
*/
function __process_xml($response)
{
$xml = new XML($response);
$result = $xml->toArray();
$xml->__killParent();
$xml->__destruct();
$xml = null;
unset($xml);
return $result;
}
示例2: setBody
public function setBody(\SimpleXMLElement $body)
{
$this->data = null;
$parser = new XML();
$data = $parser->toArray($body);
if (!isset($data['@attributes']['type']) || !isset($data['@attributes']['msg'])) {
return;
}
$this->data = $data;
}
示例3: process
/**
* undocumented function
*
* @param string $options
* @return void
* @access public
*/
function process($options = array())
{
$defaults = array('type' => 'redirect', 'tId' => false);
$options = am($defaults, $options);
if ($options['type'] == 'redirect') {
$myXml = $this->inquiry($options['tId']);
App::import('Core', 'Xml');
$xml = new XML($myXml);
$data = $xml->toArray();
return array('order_id' => $data['PaymentService']['Reply']['OrderStatus']['orderCode'], 'url' => $data['PaymentService']['Reply']['OrderStatus']['reference']['value']);
}
return false;
}
示例4: __formatResponse
/**
* Format the API response into an array, given the expected response type
*
* @param array Response to format
* @param string Response type
* @return array Array formatted API response
*/
private function __formatResponse($response, $format)
{
if (in_array($format, array('xml', 'rss', 'atom'))) {
$xml = new XML($response);
$array = $xml->toArray(false);
unset($xml);
$response = $this->__fixXml($array);
if (isset($response['bitly'])) {
$response = array('results' => $this->__fixBitlyXml($response['bitly']['results']));
}
} elseif ($format === 'json') {
$response = json_decode($response, true);
}
return $response;
}
示例5: XMLToArray
public static function XMLToArray($xml, $recursionDepth = 0)
{
XML::toArray($xml, $recursionDepth);
}
示例6: XML
function __process($response)
{
$xml = new XML($response);
return $xml->toArray();
}
示例7: XML
function __to_array($response = '')
{
$xml = new XML($response);
$array = $xml->toArray();
$xml->__killParent();
$xml->__destruct();
$xml = null;
unset($xml);
return $array;
}
示例8: XML
/**
*
* @param string data to process
* @return array Twitter API response
*/
function __process($response)
{
$xml = new XML($response);
$array = $xml->toArray();
$xml->__destruct();
$xml = null;
unset($xml);
return $array;
}
示例9: XML
function __process($response)
{
/* Note: this will fail to properly distinguish among link tags -- see
__parse_atom above for a better alternative */
$xml = new XML($response);
$array = $xml->toArray();
$xml->__killParent();
$xml->__destruct();
$xml = null;
unset($xml);
return $array;
}