您好,欢迎访问一九零五行业门户网

生成的静态页 怎么把里面PHP地址改成html地址

define('cache_file', '111.html');function callback($buffer) {  file_put_contents(cache_file, $buffer, file_append);  return $buffer; //不需显示页面内容就 return '';}file_put_contents(cache_file, '');ob_start(callback, php_output_handler_start);
jingtai.php
先只生成了
jingtai.html
怎么把123.php改成123.html呢
回复讨论(解决方案) 你在
file_put_contents('111.html', $buffer);
前先执行
$buffer = preg_replace('/(href=.+?)\.php/', '$1.html', $buffer);
不过规则可能没那么简单,你想好了再说
其它类似信息

推荐信息