PHP½ØÈ¡¹Ì¶¨³¤¶È×Ö·û´®º¯Êý
<?php
function toFixLen($str,$len){ //¹Ì¶¨³¤¶È×Ö·û´®µÄ½ØÈ¡
if($len>=strlen($str)||!$len) return $str;
$len-=3;
$tempstr1 = substr($str,0,$len); //½ØÈ¡×Ö·û´®
$tempstr2 = preg_replace('/([\x81-\xff]+)$/ms','',$tempstr1,1); //È¥µô½áβµÄÁ¬Ðøºº×Ö×Ö·û
if(!is_int((strlen($tempstr1)-strlen($tempstr2))/2)){ //È¥µôµÄ×Ö·ûÎªÆæÊý?
$tempstr1 = substr($str,0,$len-1);
}
return $tempstr1."…";
}
?>
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/renren000/archive/2009/02/02/3858694.aspx
Ïà¹ØÎĵµ£º
ѧϰĿµÄ£ºÑ§»áÓÃPHPÉÏ´«ÎļþºÍ·¢Óʼþ
¡¡¡¡ÉÏ´«Îļþ±íµ¥±ØÐë¼ÓÉÏ enctype="multipart/form-data" ºÍ <input type="file" name="file">
¡¡¡¡
¡¡¡¡ÏÂÃæ¿´Ò»Ï´úÂ룺
¡¡¡¡$f=&$HTTP_POST_FILES['file'];
¡¡¡¡$dest_dir='uploads';//É趨ÉÏ´«Ä¿Â¼
¡¡¡¡$dest=$dest_dir.'/'.date("ymd")."_".$f['name'];// ......
ÏîÄ¿ÐèÒªÓõ½ ÐÂÎÅÄÚÈÝÒ³ ʵÏÖ·ÖÒ³¹¦ÄÜ£¬Ëæ±ãдÁËһϡ£
¸ø´ó¼Ò×ö¸ö²Î¿¼£¬Ð´µÄ²»ºÃ»¹ÍûÁ½Ⱑ£¡
//ÐÂÎÅÄÚÈÝ·ÖÒ³¿ªÊ¼ The page next for news content start
$nextpage="<!--{nextpage}-->";//·ÖÒ³±êʾ.
$content=explode($nextpage,$content);
$sum=count($content);
$mpurl=$_SERVER['PHP_SELF']."?newsid ......
1,¶¨Î»Êý×飺
bool in_array ( mixed needle,array haystack[,bool strict]) ²éÕÒÖ¸¶¨ÔªËØ£»
array array_keys (arraqy input [, mixed search_value]) ·µ»Ø¼üÖµ×é³ÉµÄÊý×飻
bool array_key_exists(mixed key,array search) ÅжϼüÖµÊÇ·ñΪָ¶¨µÄ¼üÖµ£»
array array_values (array input) ·µ»ØÊý×éÖеÄÔªËØÖµ£ ......
Êý¾Ý¿âÊÇsqlserver2005,Êý¾Ý´æ´¢µÄ¾ßÌå±àÂë²»Ïê. µ½ÍøÉÏÕÒÁ˶ÎתÂ뺯Êý /* ¶¨Òå×Ö·ûת»»º¯Êý£¬½â¾ömssqlÖÐÎÄÂÒÂëÎÊÌâ */
function convert2utf8($string)
{
......
ÒýÓÃhttp://www.linuxtone.org/html/76/t-2776.html
ÓÐʱºònginx£¬apache£¬mysql£¬php±àÒëÍêÁËÏë¿´¿´±àÒë²ÎÊý¿ÉÒÔÓÃÒÔÏ·½·¨
nginx±àÒë²ÎÊý£º
#/usr/local/nginx/sbin/nginx -V
CODE:
nginx version: nginx/0.6.32
built by gcc 4.1.2 20071124 (Red Hat 4.1.2-42)
configure arguments: --user=www --group=www --p ......