本文整理匯總了PHP中DomDocument::LoadXML方法的典型用法代碼示例。如果您正苦於以下問題:PHP DomDocument::LoadXML方法的具體用法?PHP DomDocument::LoadXML怎麽用?PHP DomDocument::LoadXML使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DomDocument
的用法示例。
在下文中一共展示了DomDocument::LoadXML方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _getNewImportProcessResult
/**
* NOT IN USE /////////////////////
*
* Get the result form New Import Process
*
* @param string
* @return array
*/
protected function _getNewImportProcessResult($param = 'ReturnCode')
{
if (!is_object($this->soapClient)) {
return FALSE;
}
$this->xmlResponse = $this->soapClient->__getLastResponse();
$dom = new DomDocument();
$dom->loadXML($this->xmlResponse) or die('File XML non valido!');
$xmlResult = $dom->getElementsByTagName('mailupMessage');
$this->domResult = new DomDocument();
$this->domResult->LoadXML(html_entity_decode($xmlResult->item(0)->nodeValue)) or die('File XML non valido!');
if (isset($this->domResult) && is_object($this->domResult)) {
$rCode = $this->domResult->getElementsByTagName($param);
return $rCode->nodeValue;
} else {
$this->_config()->log('getNewImportProcessResult [No ReturnCode]');
return 9999;
}
return FALSE;
}
示例2: DOMDocument
function xmlstr_to_array($xmlstr, $params)
{
$doc = new DOMDocument();
$doc->loadXML($xmlstr) or die("File XML non valido!");
$xmlResult = $doc->getElementsByTagName("GetListsResult");
//echo "XmlReuslt:" . $xmlResult;
$domResult = new DomDocument();
$domResult->LoadXML(html_entity_decode($xmlResult->item(0)->nodeValue)) or die("File XML1 non valido!");
$rCode = $domResult->getElementsByTagName("list");
for ($i = 0; $i < $rCode->length; $i++) {
$obj = new stdClass();
// $out[] = array();
foreach ($params as $k => $v) {
$obj->{$v} = $rCode->item($i)->getElementsByTagName($v)->item(0)->nodeValue;
}
$out[] = $obj;
}
return $out;
}