我有以下代码来查找与 preg_match 匹配的 xml 元素
foreach($xml->Items->Item->AlternateVersions->AlternateVersion->Binding as $BookBinding) { //loop through the xml data to find the correct ASIN for the kindle edition
foreach ($xml->Items->Item->AlternateVersions->AlternateVersion->ASIN as $Kindlestring)
{
var_dump ($BookBinding);
if (preg_match('/Kindle Edition/i',$BookBinding))
{
//do stuff
}
}
}
然而它只是 var_dumping Binding 的第一个循环,怎么会呢?