【发布时间】:2012-05-30 20:08:51
【问题描述】:
您能否告知 php.ini 中简单 xml 的数组通配符是什么?我想从数组的第二部分获得通配符响应。它仅在错误填充有数字时才起作用,通配符是什么,因此它将带回 stuff 数组 0 中的所有错误。
例子
$xml->Test->Account->Information->Stuff[0]->Next->Next->Error[]['Duration'];
【问题讨论】:
您能否告知 php.ini 中简单 xml 的数组通配符是什么?我想从数组的第二部分获得通配符响应。它仅在错误填充有数字时才起作用,通配符是什么,因此它将带回 stuff 数组 0 中的所有错误。
例子
$xml->Test->Account->Information->Stuff[0]->Next->Next->Error[]['Duration'];
【问题讨论】:
类似
$results = array();
foreach ($xml->Test->Account->Information->Stuff[0]->Next->Next->Error as $error) {
$results[] = $error['Duration'];
}
【讨论】:
$xml->xpath('//Test/Account/Information/Stuff[1]/Next/Next/Error[@Duration]')