PHP С¼¼ÇÉ
=================================
mb_substr($str, 0, 1, "gbk");
Èç¹ûÌṩÁ˵ÚËĸö²ÎÊý£¬php»á½âÎöÕâ¸ö²ÎÊý
1. ½«Õâ¸ö²ÎÊýת»»³É×Ö·û´®.
2. µ÷ÓÃmbfl_name2no_encoding»ñµÃ±àÂëÆ÷ÐòºÅ
3. µÚ¶þ²½»áµ÷ÓÃmbfl_name2encoding£¬Õâ¸öº¯ÊýÔÚÑ»·ÖÐʹÓÃÁËstrcasecmp
strcasecmpÊǺöÂÔ´óСдµÄ×Ö·û´®Æ¥Å䣬ÐÔÄܺܵͣ¬
¶øÇÒ£¬Èç¹ûµÚËĸö²ÎÊýÌṩµÄ ±àÂëÃû×Ö ²»¹æ·¶£¬»áÔì³É±ê×¼Ãû×ÖÁбíÖÐÕÒ²»µ½
»¹»á×ö½øÒ»²½µÄ³¢ÊÔ£¬´ÓMIME charset nameÖÐÑ°ÕÒ£¬Èç¹û»¹ÊÇÕÒ²»µ½
»á¼ÌÐø³¢ÊÔ£¬Í¨¹ý±ðÃûÀ´²éÕÒ£¬Õâ¸ö¹ý³ÌÊÇÏ൱ÂýµÄ£¬¼ÙÈçÓÐ20ÖÖ±àÂ룬ÿÖÖÓÐ10¸ö±ðÃû
¾ÍÒª´Ó20*10¸ö×Ö·û´®ÖУ¬²éÕÒ³öÆ¥ÅäµÄ£¬»¹ÊDz»Çø·Ö´óСдµÄÆ¥Å䣬Ï൱µÄÂý
ËùÒÔ£¬¾¡Á¿Ê¹ÓøúÄÚ²¿±àÂëÒ»ÖµıàÂ룬Èç¹û²»ÄÜ£¬±àÂëÃû×ÖÒ»¶¨ÒªÐ´µÄ¹æ·¶
½â¾ö·½°¸£º
mb_internal_encoding("gbk");
for($i = 0; $i < 100000; $i ++){
$a = mb_substr($str, 0, 1);
}
=================================
ÎÒÃǾ³£»áÓõ½file_get_contentsº¯Êý,ÓÃÓÚץȡ±ðÈËÍøÕ¾µÄÐÅÏ¢,ÖÆ×÷¼òµ¥µÄ²É¼¯Æ÷,µ«ÊÇÔÚʹÓÃfile_get_contentsº¯ÊýµÄʱºò£¬¾³£»á³öÏÖ³¬Ê±µÄ´íÎó£¬ÕâÀï½éÉÜÁ½ÖÖ½â¾ö°ì·¨£º
Ò»¡¢Ôö¼Ó³¬Ê±µÄʱ¼äÏÞÖÆ
ÕâÀïÐèҪעÒ⣺set_time_limitÖ»ÊÇÉèÖÃÄãµÄPHP³ÌÐòµÄ³¬Ê±Ê±¼ä£¬¶ø²»ÊÇfile_get_contentsº¯Êý¶ÁÈ¡URLµÄ³¬Ê±Ê±¼ä¡£
ÎÒÒ»¿ªÊ¼ÒÔΪset_time_limitÒ²ÄÜÓ°Ïìµ½file_get_contents£¬ºóÀ´¾²âÊÔ£¬ÊÇÎÞЧµÄ¡£ÕæÕýµÄÐÞ¸Äfile_get_contentsÑÓʱ¿ÉÒÔÓÃresource $contextµÄtimeout²ÎÊý£º
´úÂëÈçÏÂ:
$opts = array(
'http'=>array(
'method'=>”GET”,
'timeout'=>60,
)
);
$context = stream_context_create($opts);
$html =file_get_contents('http://www.phpzixue.cn', false, $context);
fpassthru($fp);
¶þ¡¢Ò»´ÎÓÐÑÓʱµÄ»°ÄǾͶàÊÔ¼¸´Î
ÓÐʱºòʧ°ÜÊÇÒòΪÍøÂçµÈÒòËØÔì³É£¬Ã»Óнâ¾ö°ì·¨£¬µ«ÊÇ¿ÉÒÔÐ޸ijÌÐò£¬Ê§°ÜʱÖØÊÔ¼¸´Î£¬ÈÔȻʧ°Ü¾Í·ÅÆú£¬ÒòΪfile_get_contents()Èç¹ûʧ°Ü½«·µ»Ø FALSE£¬ËùÒÔ¿ÉÒÔÏÂÃæÕâÑù±àд´úÂ룺
¸´ÖÆ´úÂë ´úÂëÈçÏÂ:
$cnt=0;
while($cnt < 3 && ($str=@file_get_contents('http://www.phpzixue.cn'))===FALSE) $cnt++;
=========================================
´úÂëÁ¿Í³¼Æ
ͳ¼Æ.phpºÍ.htmÎļþ ÐèÒªµ¥´ÊºÍ×Ö·ûÐÅÏ¢£¬°Ñwc -lµÄ-lÈ¥µô
find path_to_source -type f -name
Ïà¹ØÎĵµ£º
ÔÚcentos5.3Ï°²×°GCCËù±ØÐëµÄ5¸öÒÀÀµ°ü
×îС»¯°²×°centos5.3£¬Ä¬ÈÏûÓа²×°gcc,ÀûÓÃÏÂÔصݲװDVD£¬Í¨¹ýfilezillaÉÏ´«£¬·¢ÏÖGCCËù±ØÐëµÄ5¸öÒÀÀµ°üΪ£º
kernel-headers-2.6.18-128.el5.i386.rpm
cpp-4.1.2-44.el5.i386.rpm
libgomp-4.3.2-7.el5.i386.rpm   ......
Ò»¡¢°²×°
1. Ê×ÏÈ°²×°SSH
sudo apt-get install ssh
2.°²×°MySQL(ËäÈ»ÏÖÔÚ×îаæΪ5.1£¬µ«ÊÇ»¹Ö»ÄÜ×°5.0°æ±¾)
sudo apt-get install mysql-server-5.0
3.°²×°Apache
sudo apt-get install apache2
4.°²×°PHP
sudo apt-get install php5 libapache2-mod-php5
5.ÖØÆôApache
sudo /etc/init.d/apache2 restart ......
1¡¢Ç°ÑÔ
¡¡¡¡·ÖÒ³ÏÔʾÊÇÒ»Öַdz£³£¼ûµÄä¯ÀÀºÍÏÔʾ´óÁ¿Êý¾ÝµÄ·½·¨£¬ÊôÓÚweb±à³ÌÖÐ×î³£´¦ÀíµÄʼþÖ®Ò»¡£¶ÔÓÚweb±à³ÌµÄÀÏÊÖÀ´Ëµ£¬±àдÕâÖÖ´úÂëʵÔÚÊǺͺôÎüÒ»Ñù×ÔÈ»£¬µ«ÊǶÔÓÚ³õѧÕßÀ´Ëµ£¬³£³£¶ÔÕâ¸öÎÊÌâÃþ²»×ÅÍ·Ð÷£¬Òò´ËÌصØ׫д´ËÎĶÔÕâ¸öÎÊÌâ½øÐÐÏêϸµÄ½²½â£¬Á¦ÇóÈÿ´ÍêÕâƪÎÄÕµÄÅóÓÑÔÚ¿´ÍêÒÔºó¶ÔÓÚ·ÖÒ³ÏÔʾµÄÔ ......
±àд¹ØÓÚ PHP µÄϵÁÐÎÄÕÂÈÃÎÒ¸ü¼ÓÉî¿ÌµØÁ˽âÁË PHP ¿ª·¢ÈËÔ±µÄÊÀ½ç¡£ÎÒºÍÐí¶à PHP ³ÌÐòÔ±½»Ì¸¹ý£¬×îÁîÎÒ¾ªÆæµÄÊÇÖ»ÓкÜÉÙµÄÈËʹÓà IDE¡£´ó¶àÊý³ÌÐòԱʹÓÃÎı¾±à¼Æ÷£¬±ÈÈç Microsoft® Windows® ÉϵļÇʱ¾¡¢Emacs »òÕß Vim¡£
ÎÒÌáµ½µÄÕâЩÎı¾±à¼Æ÷£¨ÒÔ¼°ÎÒûÌáµ½£©¶¼ÊǺܲ»´íµÄ —— ÎÒ²»ÏëÌÖÂÛ ......
½ñÌìÔÚ¼ÒÀïÖØа²×°ÁËÒ»ÏÂPHP µ±ÈÃÒ²ÓÐApacheÁË¡£µ«ÊÇÎÒÓöµ½ÁËÒ»¸öÎÊÌ⣬¾ÍÊÇApache·þÎñÎÞ·¨¿ªÆô£¬ºó¹ûÔõÑùÎÒÏëºÜ¶àÈ˶¼ÊÇÖªµÀµÄ£¬µ±Ê±Ò²Ã»ÓжàÏ룬ÒÔΪÊÇ×Ô¼º°²×°µÄʱºò³öÏÖÁËʧÎó¾ÍÖØа²×°Ò»±é£¬¿ÉÊÇ»¹ÊÇÒ»ÑùÎÞ·¨´ò¿ª£¬È»ºóÎÒ¾ÍÔÚÏëÊÇʲôÎÊÌ⣬¶Ë¿ÚºÅ80.ÎҲ鿴ÁËһϣ¬·¢ÏÖûÓдíÎó°¡£¬Ë¼¿¼Á˺ܾ㬶ÔÍøÂçÒÔ¼°·À» ......