PHP Log Class
ob_start();
echo "<pre>";
print_r($content);
echo "</pre>";
$a=ob_get_contents();
$filename = $_SERVER['DOCUMENT_ROOT']."/log-".date("Y-m-d").".txt";
$file = fopen($filename, "a");
$tipmsg = "\r\n******Final File: "
//.end(explode('/',$_SERVER['PHP_SELF']))
.$_SERVER['PHP_SELF']
."\r\n******Code Container: "
.str_replace("\\","/",substr(__FILE__,strlen($_SERVER['DOCUMENT_ROOT'])))
."\r\n******Time: "
.date("Y-m-d H:i:s")."\r\n\r\n";
fwrite($file, $a.$tipmsg);
fclose($file);
ob_end_clean();
相关文档:
{一}PHP中this,self,parent的区别之一this篇
面向对象编程(OOP,Object Oriented Programming)现已经成为编程人员的一项基本技能。利用OOP的思想进行PHP的高级编程,对于提高PHP编程能力和规划web开发构架都是很有意义的。
PHP5经过重写后,对OOP的支持额有了很大的飞跃,成为了具备 ......
PHP条件语句的介绍与应用
1、if 条件语句
if(expr)
echo TRUE
else
echo FALSE
if(expr) {
echo TRUE
}else{
echo FALSE
}
f(expr) {
echo&n ......
在学习php时,看到的,做个笔记
字符串头部:^
<?php echo ereg(“^hello”,”hello world!”); ?>
字符串尾部:$
<?php echo ereg(“bye$”,”goodbye”); ?>
任意的单个字符:.
<?php echo ereg(“.”,”goodbye”); ......
<?php
//定义一个数组
$arr = array(0=>"zero", 1=>"one", 2=>"two");
//使用第一种方法对数组进行遍历
foreach ($arr as $value) {
echo "Value: $value; ";
}
echo "<BR>";&nb ......
Perl is a language often associated with text processing and CGI. PHP is
a language often associated with dynamic Web pages. Both are very popular
with Web developers. Often, each of these languages is used at the expense of
the other. Hard-core Perl developers would love to develop everyth ......