"Qualifiers->ItemCondition", "ItemSubcondition" =>"Qual"/> "Qualifiers->ItemCondition", "ItemSubcondition" =>"Qual">

Rumah >pembangunan bahagian belakang >tutorial php >多个foreach嵌套循环的有关问题

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBasal
2016-06-13 12:06:281212semak imbas

多个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;");

Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn