...
$file = "TwoMax Inter test templet,author:Sheyi";
$fp= fopen ("temp.html","r");
^^这里是全角空格
$file = "TwoMax Inter test templet,author:Sheyi";
$fp= fopen ("temp.html","r");
^^这里是全角空格
解决方案 »
- linux下安装php5.3.0报错 求救
- 有关图片显示问题
- php里sql语句能做加法吗~~
- windows服务器上出现: PHP has encountered an Access Violation at 7C94BD02
- 请问有哪款支持PHP语法提示的IDE吗?
- 获得浏览器的信息
- 请教:做了一个文章发布系统:行间距问题
- PHP处理文本的问题!高手快来!在线等!高分!
- 关于Apache,PHP参数传递的问题
- 急啊,如何将redhat7.3中自带的php4.1.2升级为php4.2.3?
- 有什么办法把表单里的值在误提交的情况下,回退值还是保留在文本域里面的?
- 关于APACHE运行一段时间后会占100%CPU导致死机问题.
$file = "TwoMax Inter test templet,author:Sheyi";
$fp= fopen ("temp.html","r");
$content = fread ($fp,filesize ("temp.html"));
$content .= str_replace ("{ file }",$file,$content);
$content .= str_replace ("{ title }",$title,$content);
echo $content;?>小弟8月13 号 12:15分测试了一下...temp.html文件的内容为:csdn效果显示为:
C:\Discuz!EXP\wwwrootcsdn csdn csdn csdnC:\Discuz!EXP\wwwroot 为小弟机器的 apache 里的一个目录.....
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<?
$title = "PHP爱好者测试模板";
$file = "TwoMax Inter test templet,author:Sheyi";
$h=fopen("2.html","r");
$content=fread($h,filesize("2.html"));
$content.=str_replace("{file}",$file,$content);
$content.=str_replace("{title}",$title,$content);
$filename = "test.html";
$handle=fopen($filename,"w");//打开文件指针,创建文件 if (!is_writable($filename)){
die ("文件:".$filename."不可写,请检查其属性后重试!");
}
if (!fwrite ($handle,$content)){ //将信息写入文件
die ("生成文件".$filename."失败!");
}
fclose ($handle); //关闭指针
die ("创建文件".$filename."成功!");?>
</body>
</html>