function qidizi($obj,$title='',$open_mode='w',$str = null)
{//----------------qidizi:测试函数-----------
//当 $title===1 时表示显示完成后中止页面;
if ($str && (stristr($_SERVER["REQUEST_URI"],$str)===false) )
return false;//设置了必须有参数才能调用测试时,检测
//测试代码
ob_start();
echo chr(10).chr(10).'运行时间 => '.time().chr(10);
echo $title.'值如下:'.chr(10).chr(10);
var_dump($obj);
$content = ob_get_contents();
ob_end_clean();
$file = 'qidizi_debug.txt';
if ($open_mode != 'w') $open_mode = 'a';
if ($handle=@fopen($file,$open_mode))
{
fwrite($handle,$content);
fclose($handle);
}else
{
exit("测试时打开/写入测试文件出错,可能是没有权限:$file");
}
}