本文整理匯總了PHP中Xml::buildArrayFromXml方法的典型用法代碼示例。如果您正苦於以下問題:PHP Xml::buildArrayFromXml方法的具體用法?PHP Xml::buildArrayFromXml怎麽用?PHP Xml::buildArrayFromXml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Xml
的用法示例。
在下文中一共展示了Xml::buildArrayFromXml方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: put
public function put($path, $params = null)
{
$response = $this->_doRequest('PUT', $path, $this->_buildXml($params));
$responseCode = $response['status'];
if ($responseCode === 200 || $responseCode === 201 || $responseCode === 422 || $responseCode == 400) {
return Xml::buildArrayFromXml($response['body']);
} else {
Util::throwStatusCodeException($responseCode);
}
}
示例2: parse
public static function parse($signature, $payload)
{
if (preg_match("/[^A-Za-z0-9+=\\/\n]/", $payload) === 1) {
throw new Exception\InvalidSignature("payload contains illegal characters");
}
Configuration::assertGlobalHasAccessTokenOrKeys();
self::_validateSignature($signature, $payload);
$xml = base64_decode($payload);
$attributes = Xml::buildArrayFromXml($xml);
return self::factory($attributes['notification']);
}