PHP·â×°ÀàЧÂʲâÊÔ
½ñÌì¸ÕѧÍêmysqli£¬È¥ÎÒµÄIDCÔËÓªÉÌÄÇ¿´ÁËһϣ¬·¢ÏÖËûÃǵÄÐéÄâÖ÷»ú¾ÓÈ»²»Ö§³Ö£¬ÎÒÓÖÈ¥ÆäËû¼¸¼Ò¿´ÁË¿´£¬ÓеÄÖ§³ÖÓеIJ»Ö§³Ö¡£
ÎÒ¾ÍÏë×Ô¼ºÐ´¸öÀ࣬ÈÃËûÈ¥Åжϣ¬ÄÜÓÃmysqli¾ÍÓÃmysqli£¬·ñÔò¾ÍÓÃÔʼµÄmysqlº¯Êý¡£²»¹ýÎÊÌâÂíÉϾÍÀ´ÁË£¬×Ô¼ºÐ´Àà»á²»»áµ¼ÖÂÖ´ÐÐЧÂʱäµÍÁËÄØ£¿ÓÚÊÇÎҾͽøÐÐÁËÈçϲâÊÔ¡£
ÕâÊÇÓÃÀ´¼ÆʱµÄÀࣺ
/**
* ¼ÆËã´úÂëÖ´ÐÐʱ¼ä
* $counting : µ±Ç°µÄ¼Æʱ״̬
* $startTime £º ¿ªÊ¼¼ÆʱµÄʱ¼ä
* $totalTime : ´úÂëÖ´ÐеÄÓÃʱ
* getTime() : È¡µÃµ±Ç°Ê±¼ä£¨ÒÔ΢ÃëΪµ¥Î»£©
* start() : ¿ªÊ¼¼Æʱ
* show() : ÏÔʾִÐдúÂëµÄÓÃʱ
*
*/
class Counter
{
private $counting;
private $startTime;
private $totalTime;
function __construct(){
$this->start();
}
private function getTime(){
list($msec,$sec) = explode(' ',microtime());
return $sec+$msec;
}
function start(){
$this->counting = TRUE;
$this->startTime = $this->getTime();
}
function stop(){
$this->counting = FALSE;
$this->totalTime = ($this->getTime() - $this->startTime)*1000000;
}
function show(){
$this->counting == TRUE && $this->stop();
echo "<br>ºÄʱ£º".$this->totalTime." ΢Ãë<br>";
$this->start();
}
}
ÕâÊÇÖ´ÐеĴúÂë1£º
class Myobj
{
function myf($str){
preg_match('/456/',$str);
}
}
$obj = new Myobj();
$str = '123456789';
$counter = new Counter();
for($i=0;$i<10000;$i++){
$obj->myf($str);
}
$counter->show();
²âÊÔÎå´ÎÓõÄʱ¼ä·Ö±ðΪ£º
15283
15861
15658
15663
16229
ÕâÊÇÖ´ÐеĴúÂë2(Ö±½Óµ÷Óú¯Êý£¬²»ÓÃ×Ô¼ºµÄÀà)£º
$str = '123456789';
$counter = new Counter();
for($i=0;$i<10000;$i++){
preg_match('/456/',$str);
}
$counter->show();
²âÊÔÎå´ÎÓõÄʱ¼ä·Ö±ðΪ£º
9087
9501
9026
9413
9989
¿É¼û£¬Ö±½Óµ÷Óú¯Êý±Èµ÷ÓÃ×Ô¼º·â×°µÄº¯Êý¿ìÁË5000΢Ãë×óÓÒ£¬Õ§Ò»¿´£¬ºÃÏñͦÏÅÈ˵ģ¬¿É×ÐϸһÏ룬5000΢Ãë==5ºÁÃë==0.005Ã룬¶øÇÒÎÒÕûÕûµ÷ÓÃÁË10000´Î£¬Õâôµã²î¾à£¬¿Ï¶¨Ã»
Ïà¹ØÎĵµ£º
²»¹ýÕâ¸ö²»ÄܺͷÉÐÅ¿Í»§¶ËͬʱµÇ¼£¬¶þÕßÖ»ÄܵÇÒ»¸ö£¬Ö»Òª´úÂëÔÚdwÀï´ò¿ª£¬¿Í»§¶Ë¾ÍµôÁ˺ǺÇ~~~
<?php
/*
* Created on 2010-4-18
* MiaoPengFei
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
$data["username"] = ;//ÕâÀïÌ ......
ÔÚIIS»ù´¡ÉϽ¨Á¢PHP»·¾³×Ü»á³öÏÖÕâÑù»òÄÇÑùµÄÎÊÌ⣬ºÜ¶àÎÊÌⶼ±È½ÏÄѽâ¾ö£¬±ÊÕß×î½üÔÚ½¨Á¢IISÏÂPHP»·¾³Ê±¾ÍÓöµ½Á˳öÏÖ·ÃÎʳö´íµÄÎÊÌ⣬ËùÓÐphpÒ³ÃæÎļþÎÞ·¨Õý³£ÏÔʾ³öÀ´£¬¶øASP»¹ÓÐHTML¾²Ì¬Ò³ÃæÄܹ»Ë³Àû·ÃÎÊ¡£ÏÂÃæ¾ÍÇë¸÷λIT168µÄ¶ÁÕßËæÎÒÒ»Æð´ÓȨÏÞÈëÊÖ½â¾öIIS+PHP»·¾³¹ÊÕÏ¡£
Ò»¡¢¹ÊÕÏÏÖÏó£º
±ÊÕß´î½ ......
1¡¢Èç¹ûÄܽ«ÀàµÄ·½·¨¶¨Òå³Éstatic£¬¾Í¾¡Á¿¶¨Òå³Éstatic£¬ËüµÄËٶȻáÌáÉý½«½ü4±¶¡£
2¡¢$row['id'] µÄËÙ¶ÈÊÇ$row[id]µÄ7±¶¡£
3¡¢echo ±È print ¿ì£¬²¢ÇÒʹÓÃechoµÄ¶àÖزÎÊý(Òë×¢£ºÖ¸ÓöººÅ¶ø²»ÊǾäµã)´úÌæ×Ö·û´®Á¬½Ó£¬±ÈÈçecho $str1,$str2¡£
4¡¢×îºÃʹÓÃForeachÖ´ÐÐÑ»·£¬ÔÚÖ´ÐÐforÑ»·Ö®Ç°È·¶¨×î´óÑ»·Êý£¬²»ÒªÃ¿Ñ»·Ò»´ ......
¼ÙÈçÒ»¸ötextareaÖÐÓÐN¶àÐеÄÊý¾Ý,Òª½«ËüתΪPHPµÄһάÊý×é,
<form id="textarea_test" action="textarea.php" method="post">
<textarea cols="50" rows="5" name="aa" id="abc" >
<?php
$str = $_POST['aa'];
//var_dump($str);
//$str = "chenjinle le";
$array = explode("\n", trim($ ......
php cliÃüÁîÐÐģʽÊÇWINϵÄÒ»¸öSHELL£¬²»ÐèÒªAPACHEµÄÖ§³Ö¾ÍÄÜÖ´ÐÐPHP½Å±¾µÄ½Å±¾£¬²¢ÇÒÊdzÖÐøÖ´Ðеġ£ÕâЩÌصãºÜÈÝÒ×ÀûÓÃÀ´¿ìËÙ²âÊÔPHP½Å±¾¡£½ñÌì¾ÍÌØÒâÕÒÀ´Ò»Ð©×ÊÁÏ£¬ÕûÀíÁËһϣ¬È¨µ±¸´Ï°¡£
D:\AppServ\php5>php -help
Usage: php [options] [-f] <file> [--] [args...]
&nbs ......