function templateContorl($path,$filename){
ob_start();
require_once('14.html');//随便写了一个文件
$contents=ob_get_contents();
ob_end_clean();;
createFile($path,$filename,$contents);//创建并写文件 这里没有错误
}for($i=1;$i<=4;$i++){
$filename=$i.'html'; $path2='d:/'
templateContorl($path2,$filename);
}此时只能输出第一个文件,其他均为空(0字节),如果$i从3循环 只能输出第三个文件其他为空,
期待回复,不胜感激,是不是哪里的设置有问题啊!
ob_start();
require_once('14.html');//随便写了一个文件
$contents=ob_get_contents();
ob_end_clean();;
createFile($path,$filename,$contents);//创建并写文件 这里没有错误
}for($i=1;$i<=4;$i++){
$filename=$i.'html'; $path2='d:/'
templateContorl($path2,$filename);
}此时只能输出第一个文件,其他均为空(0字节),如果$i从3循环 只能输出第三个文件其他为空,
期待回复,不胜感激,是不是哪里的设置有问题啊!
语法错误不少,编译器是怎么通过的
你可以用location.href传递参数给自身,让自身不断循环来做,不管你要一次生成几百万还是几千万页面都不会超时.
另外ob_start(); 会让内容放入buffer,,除非遇到ob_end才会输出.
ob_start();
require_once('14.html');//随便写了一个文件这就是你测试失败的原因
1、require_once 已加载则不加载
2、require 在编译阶段就已完成,不会在运行中动态加载
应改用 include