本文整理匯總了PHP中XMLParser::getAttribute方法的典型用法代碼示例。如果您正苦於以下問題:PHP XMLParser::getAttribute方法的具體用法?PHP XMLParser::getAttribute怎麽用?PHP XMLParser::getAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XMLParser
的用法示例。
在下文中一共展示了XMLParser::getAttribute方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Create a Response
*
* When creating a transaction response, the constructor will look
* for the appropriate fields in the raw response XML and then parse
* them out into the corresponding members of this class.
*/
public function __construct($raw_response_data, $node_name, $mode = 'sandbox')
{
$this->xml_node_name = $node_name;
$this->setCode(\XMLParser::getNode($raw_response_data, 'response'));
$this->order_id = \XMLParser::getAttribute($raw_response_data, $this->xml_node_name, 'id');
$this->litle_txn_id = \XMLParser::getNode($raw_response_data, 'litleTxnId');
$this->time = (new \DateTime(\XMLParser::getNode($raw_response_data, 'responseTime')))->format('Y-m-d H:i:s');
$this->debug = $raw_response_data;
$this->mode = $mode;
}