php生成静态页面程序
Jun 08, 2016 pm 05:30 PM模板 template.html :
复制PHP内容到剪贴板
PHP代码:
生成 generator.php :
复制PHP内容到剪贴板
PHP代码:
/*
** html静态页面生成模块
*/
$title = "cShare.ORG首页";
$content = "红绿蓝(cShare.ORG),开源软件及自由软件社区.专注于开源软件及自由软件领域,竭力推进中国开源软件及自由软件发展.为软件开发者提供开发平台,为用户带来优秀软件...";
$template = file_get_contents("template.html"); //读取模板
$template = str_replace("", $title, $template); //替换标记
$template = str_replace("", $content, $template);
while(!file_exists("number.txt")) { //如不存在编号文件,则创建一个并写入初始编号0
file_put_contents("number.txt",0);
}
$html_number = file_get_contents("number.txt");
$html_number++;
file_put_contents("number.txt",$html_number);
$html_name = "{$html_number}.html";
file_put_contents($html_name, $template); //生成静态页面
?>

인기 기사

인기 기사

뜨거운 기사 태그

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제









