从另一个PHP脚本下载PHP生成的页面的内容 [英] Download contents of the PHP generated page from another PHP script
问题描述
我在服务器上有一个PHP脚本,可以通过Content-Disposition:附件或简单的echo来实时生成XML数据,这并不重要。我将这个文件命名为www.something.com/myOwnScript.php
I have a PHP script on a server that generates the XML data on the fly, say with Content-Disposition:attachment or with simple echo, doesn't matter. I'll name this file www.something.com/myOwnScript.php
在另一台服务器上,在另一个PHP脚本中,我想要获取这个文件(以避免将文件保存到磁盘)作为字符串(使用路径www.something.com/myOwnScript.php),然后操作脚本生成的XML数据。
On another server, in another PHP script I want to be able to get this file (to avoid "saving file to disk") as a string (using the path www.something.com/myOwnScript.php) and then manipulate XML data that the script generates.
是这可能没有使用Web服务?
安全意义?
Is this possible without using web services? security implications?
谢谢
推荐答案
,是的:
$output = file_get_contents('http://www.something.com/myOwnScript.php');
echo '<pre>';
print_r($output);
echo '</pre>';
这篇关于从另一个PHP脚本下载PHP生成的页面的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!