php文件能不能转入htm

WBOY
Release: 2016-06-13 11:57:25
Original
1195 people have browsed it

php文件能不能转为htm?
一个做好参数的php文件,想得到最终显示的htm文件,在后台怎么可以做到?
------解决方案--------------------
ob_start('html');
function html($s) {
  file_put_contents(basename($_SERVER['PHP_SELF']) . '.htm', $s);
}
//......
------解决方案--------------------
版主都已经说了
你查这3个函数 ob_start ob_get_contents file_put_contents
------解决方案--------------------
echo file_get_contents('http://www.domain.com/index.php?action=xxx'); // 直接获取生成的html
------解决方案--------------------
你是不是想说用伪静态啊?

rewrite ^(.*)/index_(\d+)_(\d+)_(\d+).html$  $1/index.php?val1=$2&val2=$3&val3=$4   last;

这个主要是把/index.php?val1=121&val2=222&val3=232 转变成/index_121_222_232.html形式

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!