Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的脚本中使用它:
$xml = file_get_contents('gapi.account.php'); print_r($xml);
容易,对吧?
但是现在... gapi.account.php 没有被解析,怎么办?解析文件的输出是 xml。
谢谢!
您需要从外部获取文件,让它运行:
$xml = file_get_contents('http://www.example.org/gapi.account.php'); print_r($xml);
file_get_contents不执行您获取的任何内容。服务器实际上是这样做的,所以你必须像服务器上的文件一样调用file_get_contents('http://mydomain.com/gapi.account.php');
file_get_contents
file_get_contents('http://mydomain.com/gapi.account.php');