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
/*
Å׸öש£¬¾ßÌåÒª×ö³ÉʲôÑù×Ô¼º×ö¡£
*/
if(isset($_FILES['userfile']['tmp_name'])){
$userfile = $_FILES['userfile']['tmp_name']; //±£´æÔÚϵͳµÄÁÙʱλÖÃ
$userfile_name = $_FILES['userfile']['name'];//ÎļþÃû
$userfile_size = $_FILES['userfile'][ ......
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) ·µ»ØÊý×éÖеÄÔªËØÖµ£ ......
Ê×ÏȰ²×°Íêphp
ºó×îºÃ±£Áôµ±Ê±°²×°µÄÎļþ£¬±ÈÈçÎҵķ¾¶/export1/soft
#cd php-5.2.8/ext/soap
#/usr/local/php/bin/phpize
#./configure --with-php-config=/usr/local/php/bin/php-config
--enable-soap
#make
#make install
±àÒëºóµÄsoap.so
Îļþ± ......
·Ã¿Í¼ÆÊýÆ÷µÄÁ÷³ÌÈçÏÂ
µÚһλÓû§ä¯ÀÀijҳ¡£
·þÎñÆ÷³ÌÐò´ÓÊý¾Ý¿â»òÎļþÖжÁÈ¡¸ÃÒ³±»ä¯ÀÀ´ÎÊý¡£
½«´ÎÊý¼ÓÒ»´¢´æ£¬²¢½«ËüËͻصÚһλÓû§¡£
µÚ¶þλÓû§ä¯ÀÀijҳ¡£
·þÎñÆ÷³ÌÐò´ÓÊý¾Ý¿â»òÎļþÖжÁÈ¡¸ÃÒ³±»ä¯ÀÀ´ÎÊý¡£
½«´ÎÊýÔÙ¼ÓÒ»´¢´æ£¬²¢½«ËüËͻصڶþλÓû§¡£
<?php
$filename="./visit";
$handle=fop ......
½«Ò»¸ö1άÊý×é·Ö¸î³É2άÊý×é array_chunk()
$input_array = array('a', 'b', 'c', 'd', 'e');
print_r(array_chunk($input_array, 2));
±È½Ï2¸öÊý×飬array_diff_assoc£¨£©»òÕßarray_diff£¨£©£¬Èç¹û·µ»ØÖµÎª¿Õ£¬±íʾÁ½¸öÊý×éÏàͬ£¬·ñÔò¾Í²»Í¬¡£
ÓÃÒ»¸öº¯ÊýÀ´¹ýÂËÊý×éÖеÄÊýÖµarray_filter()
functi ......