我需要ping一個URL和接收響應XML響應:如何處理與PHP
http://test.cellpay.com.np:8181/cellcom?FN=123&fromMobile=01670746301&phoneNumber=01970746301&PIN=1234567890&amount=0
的響應是XML格式。我正在嘗試使用PHP讀取響應。 如果我使用:
file_get_contents($url);
它表明:
file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0
如果我使用:
file_get_contents($url);
它表明:
bool(false)
Uncaught exception 'Exception' with message 'String could not be parsed as XML'
我不知道該怎麼請幫助我。
謝謝。
更改第一條錯誤消息中給出的設置,或找到一個新的主機。 – rjdown 2015-02-06 11:01:14
您可以使用PHP xml解析器。可能是這可以幫助你http://stackoverflow.com/questions/188414/best-xml-parser-for-php – shakthydoss 2015-02-06 11:01:25
我已經和我的主機服務器聊過,並啓用了url_fopen。但仍然返回,bool(false)。你的鏈接建議如何處理數據。但我在接收數據方面遇到問題。請告訴我如何接收數據。請檢查鏈接[鏈接] http://test.cellpay.com.np:8181/cellcom?FN=123&fromMobile=01670746301&phoneNumber=01970746301&PIN=1234567890&amount=0 [/ link]是不是xml? – Shuhail 2015-02-06 14:29:52