我需要對從遠程服務器訪問並由simpleXML訪問的XML文件進行排序(它是從提供者訪問規範中的文件的批准方式 - 所以不能改變)按字段排序遠程XML文件
$propertylist = simplexml_load_file("http://link.to/file.xml?accesskey");
我需要梳理上$propertylist->price
前高後低,不通過管道將XML內容到一個單獨的文件
我已經看到了(並試圖)在這裏找到,沒有了若干建議成功:(
arsort($propertylist->price);
打破代碼
這裏是XML的摘錄:
<?xml version="1.0" encoding="UTF-8"?>
<properties>
.......
<property>
<propertyID />
<branchID>1</branchID>
<clientName>y</clientName>
<branchName>z</branchName>
<department>S</department>
<referenceNumber>1</referenceNumber>
<price>219950</price>
<fullDescription><![CDATA[<strong>LOCATION</strong>]]></fullDescription>
<flags>
<flag />
</flags>
<images>
<image modified="2014-05-22 11:10:33">http://link.to/image.jpg</image>
</images>
<epcFrontPages />
<brochures>
<brochure modified="2014-05-22 14:37:38">http://link.to/file.pdf</brochure>
</brochures>
</property>
.......
</properties>
任何幫助非常感謝
能否請您添加XML的例子! –
我很困惑你想要什麼@Ismail,頁面正常工作,因爲它現在只是未排序 - 我可以發佈整個頁面代碼,如果這將有所幫助 –
只是一個XML部分,源XML! –