php 页面页面静态化 $fp = fopen($path, 'wb'); fwrite($fp, $html); fclose($fp)
<?phpdate_default_timezone_set('PRC');$html=file_get_contents($_SERVER['DOCUMENT_ROOT...
<?php
date_default_timezone_set('PRC');
$html = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/template.tpl');
$title = '新闻';
$header = '新闻内容';
$content = '我中大奖了';
$html = preg_replace('/\{\$title\}/', $title, $html);
$html = preg_replace('/\{\$header\}/', $header, $html);
$html = preg_replace('/\{\$content\}/', $content, $html);
//print $html;
//静态化页面
$path = $_SERVER['DOCUMENT_ROOT'].'/static/'.date('YmdHis').'.html';
$fp = fopen($path, 'wb');
fwrite($fp, $html);
fclose($fp);
浏览器会这么报错
帮忙看看哪里不对? 展开
date_default_timezone_set('PRC');
$html = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/template.tpl');
$title = '新闻';
$header = '新闻内容';
$content = '我中大奖了';
$html = preg_replace('/\{\$title\}/', $title, $html);
$html = preg_replace('/\{\$header\}/', $header, $html);
$html = preg_replace('/\{\$content\}/', $content, $html);
//print $html;
//静态化页面
$path = $_SERVER['DOCUMENT_ROOT'].'/static/'.date('YmdHis').'.html';
$fp = fopen($path, 'wb');
fwrite($fp, $html);
fclose($fp);
浏览器会这么报错
帮忙看看哪里不对? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询