"Qualifiers->ItemCondition", "ItemSubcondition" =>"Qual"/> "Qualifiers->ItemCondition", "ItemSubcondition" =>"Qual">
首页 > 后端开发 > php教程 > 多个foreach嵌套循环的有关问题

多个foreach嵌套循环的有关问题

WBOY
发布: 2016-06-13 12:06:28
原创
1204 人浏览过

多个foreach嵌套循环的问题

<br />$xml = simplexml_load_file($xml_uri);<br /><br />$offer_url=array(<br />					"ItemCondition"					=>"Qualifiers->ItemCondition",<br />					"ItemSubcondition"				=>"Qualifiers->ItemSubcondition",<br />					"FulfillmentChannel"			=>"Qualifiers->FulfillmentChannel",<br />					"ShipsDomestically"				=>"Qualifiers->ShipsDomestically",<br />					"ShippingTime"					=>"Qualifiers->ShippingTime->Max",<br />					"SellerPositiveFeedbackRating"	=>"Qualifiers->SellerPositiveFeedbackRating",<br />					"NumberOfOfferListingsConsidered"=>"NumberOfOfferListingsConsidered",<br />					"SellerFeedbackCount"			=>"SellerFeedbackCount",<br />					"LandedPrice"					=>"Price->LandedPrice->Amount",<br />					"ListingPrice"					=>"Price->ListingPrice->Amount",<br />					"Shipping"						=>"Price->Shipping->Amount",<br />					"MultipleOffersAtLowestPrice"	=>"MultipleOffersAtLowestPrice"<br /><br />);<br /><br />foreach($xml->GetLowestOfferListingsForASINResult->Product->LowestOfferListings->LowestOfferListing as $key)<br />{<br />foreach($offer_url as $name=>$value)<br />{<br />echo  $name."->".$key->$value."--------";<br /><br />}<br />echo "<br>";<br />}<br />  } <br />    ?><br />
登录后复制


$key->$value没有结果,请问应该怎么写??
------解决思路----------------------
echo eval("return \$key->$value;");

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板