【发布时间】:2011-07-07 17:12:19
【问题描述】:
我使用此脚本自动将 PHP 文件保存到我服务器上的 HTML 文件中:
<?php
$page=file_get_contents('http://yourdomain.com/index.php');
$fp=fopen('index.html','w+');
fputs($fp,$page);
fclose($fp);
?>
如何让服务器同时在服务器上保存一个 Gzipped 版本的 index.php?
目标是在文件夹中有以下文件:
把-indexphp-into-indexhtml-and-indexgz.php
index.php
index.html
index.gz
【问题讨论】:
-
请记住,您无法获取 php 文件的实际来源,因为引用 yourdomain.com/index.php 会产生代码的处理输出,例如HTML 或者它可能是什么。
-
我不确定我理解你的意思。你是说我的服务器上无法使用 PHP 保存一个 Gzipped 版本的 index.php 吗?
-
你会得到文件的输出,而不是源文件。