1、打开目录:phpcmstemplatesdefaultcontent。
2、修改网站首页文件为:indexhtml文件即可。
php作为网络开发的强大语言之一,现在应用非常广泛,具有开放源代码,跨平台性强,开发快捷,效率高,面向对象,并且易于上手,专业专注等诸多优点。各种PHP开发框架也让程序开发变的简单有效。
<?php
$file_content = file_get_contents('1.html')
$qiqi=str_replace("abc" , "000" ,$file_content)
$filename = '1.html'
$somecontent = $qiqi
// 首先我们要确定文件存在并且可写。
if (is_writable($filename)) {
// 在这个例子里,我们将使用添加模式打开$filename,
// 因此,文件指针将会在文件的开头,
// 那就是当我们使用fwrite()的时候,$somecontent将要写入的地方。
if (!$handle = fopen($filename, 'w')) {
echo "不能打开文件 $filename"
exit
}
// 将$somecontent写入到我们打开的文件中。
if (fwrite($handle, $somecontent) === FALSE) {
echo "不能写入到文件 $filename"
exit
}
echo "成功地将 $somecontent 写入到文件$filename"
fclose($handle)
} else {
echo "文件 $filename 不可写"
}
?>
把分给我吧,上面程序调试可以实现你的要求,我写了半天呢!
用法示例:<?php
// example of how to use basic selector to retrieve HTML contents
include('../simple_html_dom.php')
// get DOM from URL or file
$html = file_get_html('http://www.google.com/')
// find all link
foreach($html->find('a') as $e)
echo $e->href . '<br>'
// find all image
foreach($html->find('img') as $e)
echo $e->src . '<br>'
// find all image with full tag
foreach($html->find('img') as $e)
echo $e->outertext . '<br>'
// find all div tags with id=gbar
foreach($html->find('div#gbar') as $e)
echo $e->innertext . '<br>'
// find all span tags with class=gb1
foreach($html->find('span.gb1') as $e)
echo $e->outertext . '<br>'
// find all td tags with attribite align=center
foreach($html->find('td[align=center]') as $e)
echo $e->innertext . '<br>'
// extract text from table
echo $html->find('td[align="center"]', 1)->plaintext.'<br><hr>'
// extract text from HTML
echo $html->plaintext
?>