我使用if语句来检查XML对象是否存在,但是当我得到trying to get property of non-object error时,它不能很好地工作。foreach($resp->GetLowestOfferListingsForASINResult as $product){ $price = "";
if($product->Product->Identifiers->MarketplaceASIN->ASI
我正在尝试创建一个简单的脚本,该脚本必须将PHP数组转换为XML。但我不能让它工作..当数组只有一个维数,并且有更多维数时,所有节点都附加到"root“节点上时,该脚本工作得很好 class XML { $this->root = new SimpleXMLElement($root ? $root:$this->root);