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ÄÚÈݵ½¼ôÌù°å
PHP´úÂë:
function &test()
{
static $b=0;//ÉêÃ÷Ò»¸ö¾²Ì¬±äÁ¿
$b=$b+1;
echo $b;
return $b;
}
$a=test();//ÕâÌõÓï¾ä»áÊä³ö¡¡$bµÄÖµ¡¡Îª£±
$a=5;
$a=test();//ÕâÌõÓï¾ä»áÊä³ö¡¡$bµÄÖµ¡¡Îª2
$a=&test();//ÕâÌõÓï¾ä»áÊä³ö¡¡$bµÄÖµ¡¡Îª3
$a=5;
$a=test( ......
phpÅäÖÃÌ«¸´ÔÓÁË,×òÌìÍíÉÏÅäÖÃÁ˰ëÌ컹ûÓгɹ¦!²»µÃ²»Ñ°Çó¸ü¼òµ¥µÄ½â¾ö·½·¨:WampServer 5 ¼¯³É»·¾³
Wamp5ÊÇApache+PHP+Mysql ÔÚWindowsÏµļ¯³É»·¾³£¬ÓµÓмòµ¥µÄͼÐκÍ
²Ëµ¥°²×°¡£¸Ã°æ±¾¼¯³ÉÁËPHP5.2.5 Mysql5 Apache2 phpMyAdmin 2.11.2.1
SQLiteManager 1.2.0 ÂúÁ˴󲿷ÖPHPerµÄÐèÇó.
´ÓÓï·¨ÉÏ¿´£¬PHPÓïÑÔ½üËÆÓÚCÓï ......
PHPÊÇʹÓÃ×îΪ¹ã·ºµÄ¿ªÔ´·þÎñÆ÷¶Ë½Å±¾ÓïÑÔÖ®Ò»£¬µ±È»PHP²¢
²»ÊÇËÙ¶È×î¿ì
µÄ£¬µ«ËüÈ´ÊÇ
×î³£ÓõĽű¾ÓïÑÔ
¡£ÕâÀïÓÐ50¸öÓÐÒæµÄPHP¹¤¾ß£¬¿ÉÒÔ´ó´óÌá¸ßÄãµÄ±à³Ì¹¤×÷£º
µ÷ÊÔ¹¤¾ß
Webgrind
Xdebug
Gubed PHP Debugger
DBG
PHP_Debug
PHP_Dyn
MacGDBp
²âÊÔºÍÓÅ»¯¹¤¾ß
PHPUnit
SimpleTest
......
ASPÊÇ΢Èí¹«Ë¾ÊµÏÖ¶¯Ì¬ÍøÒ³µÄÒ»ÖÖ¼¼Êõ¡£
ASPÖ§³ÖһЩ½Å±¾ÓïÑÔ£¬Ö÷ÒªÒÔVBScriptΪÖ÷¡£
ÓëASPÏà±È½Ï£¬Ä㻹¿ÉÒÔÑ¡ÔñÁíÒ»Öпª·ÅÔ´´úÂë±à³ÌÓïÑÔ——PHP£¬PHP¿ÉÒÔÔËÐÐÔÚ¶àÖÖ²Ù×÷ϵͳÏ£¬ÆäÖаüÀ¨LinuxºÍwindows¡£
ËäÈ»ASPÊÇÒ»ÖÖ²»´íµÄ¼¼Êõ£¬µ«´Ó³¤Ô¶¿¼ÂÇÎÒÏàÐÅPHPÔÚ½«À´µÄ¼¼ÊõÁìÓòÀï»áÓв»·²µÄ±íÏÖ¡£
ÎÒÈÏΪÓÐÆß¸ ......
<?php
//¶¨ÒåÒ»¸öÊý×é
$arr = array(0=>"zero", 1=>"one", 2=>"two");
//ʹÓõÚÒ»ÖÖ·½·¨¶ÔÊý×é½øÐбéÀú
foreach ($arr as $value) {
echo "Value: $value; ";
}
echo "<BR>";&nb ......