PHP生成首页静态文件代码
分享一个 PHP生成静态首页index.html的代码
<?php
$baseCmsUrl = "https://www.LsevenTT.com";
//你网站的根目录不要加反斜杠/
$dmPageName = "index.php";
$stPageName = "index.html";
$tureStFile = dirname(__FILE__) . '/' . $stPageName;
$body = file_get_contents($baseCmsUrl . '/' . $dmPageName);
$fp = fopen($tureStFile, 'w');
fwrite($fp, $body);
fclose($fp);
header("Location:{$baseCmsUrl}/index.html");
//生成后返回静态首页
?>
本文章来自站群哥LsevenTT博客~转载请注明出处