php生成html原理核心代码
<?php
include_once('../inc/conn.php');
//$data =array('id' => 1,'title' =>'这是我的第一个生成html的标题','content' =>'php生成html的技术原理(cms)的文章内容');
$info=mysql_query("SELECT * FROM `wit_article` limit 10"); //获文章
while($data=mysql_fetch_array($info)){
//$tpl ='../templates/createhtml.html';
$tpl ='../templates/show_test .php';
$content = file_get_contents($tpl);
//$content = str_replace('{title}',$data['art_title'],$content);
//$content = str_replace('{content}',$data['art_content'],$content);
//模版片段替换
//$img=explode(',',$val[art_imgurl]);
//$art_date=sub_str($val[art_date],10,false);
//$art_date=explode('-',$art_date);
//$art_date=implode('',$art_date);
$content = str_replace('{art_title}', $data['art_title'], $content);
$content = str_replace('{art_intro}', $data['art_intro'], $content);
$content = str_replace('{content}',$data['art_content'],$content);
$content = str_replace('{art_chaid}', $data['art_chaid'], $content);
$content = str_replace('{art_id}', $data['art_id'], $content);
$content = str_replace('{art_date}',date(), $content);
$content = str_replace('{web_url}', 'http://127.0.0.1', $content);
$content = str_replace('{path}', '/witcms',$content);
file_put_contents('../test/'.$data['art_id'].'.html',$content);
}
?>http://www.xieguang133.com
东莞龙光网络
提供各种平台的解决方案
网站建设与网站改版
百度SEO(自然排名优化,年付)
中国商机发布引擎(软件)
SEO顾问咨询(门户站)
网络推广外包(月付
http://www.xieguang133.com/
posted on 2011-11-22 10:30 xieguang133 阅读(149) 评论(0) 收藏 举报
浙公网安备 33010602011771号