我在我的一個應用程序中使用了下面的代碼,並需要來自url的一些特定數據。SimpleXMLElement不能在共享服務器上工作
$url = 'http://twitter.com/#!/rubarrichello';
$sXML = new SimpleXMLElement($url, NULL, TRUE);
$screen_name = $sXML->screen_name;
我只是需要從$sXML
。這個代碼工作得很好我的本地服務器上,而不是在共享服務器上獲取的$screen_name
的價值,我已經檢查了PHP的信息文件的libxml
它如下所示:
libXML support active
libXML Compiled Version 2.7.8
libXML Loaded Version 20708
libXML str
eams enabled
我對SimpleXMLElement
的瞭解非常有限。任何人都可以指導我如何調試?
PHP的該版本上共享服務是5
如果你認爲它太基本的一個問題,請指導我使用SimpleXMLElement獲取url數據的一些很好的教程 – user1332909
http://stackoverflow.com/questions/1787064/reading-twitters-rss-search-feed -with-simple-xml也許?或者,http://stackoverflow.com/questions/4589735/get-twitter-feed-and-display-informations-using-php-simplexml?rq=1 – Ben
第一個問題:你沒有收到來自該URL的任何XML。 – Ben