Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

php¶þλÊý×éÅÅÐò

<?php
$array[] = array("id"=>20,"name"=>"li");
$array[] = array("id"=>21,"name"=>"ai");
$array[] = array("id"=>20,"name"=>"ci");
$array[] = array("id"=>22,"name"=>"di");
 
foreach ($array as $key=>$value){
 $age[$key] = $value['id'];
 
}
array_multisort($age,SORT_NUMERIC,SORT_ASC,$array);
print_r($array);
?>
ÔËÐнá¹û£º
Array (
[0] => Array ( [id] => 20 [name] => ci )
[1] => Array ( [id] => 20 [name] => li )
[2] => Array ( [id] => 21 [name] => ai )
[3] => Array ( [id] => 22 [name] => di )
)
¶¨ÒåºÍÓ÷¨
array_multisort() º¯Êý¶Ô¶à¸öÊý×é»ò¶àάÊý×é½øÐÐÅÅÐò¡£
²ÎÊýÖеÄÊý×é±»µ±³ÉÒ»¸ö±íµÄÁв¢ÒÔÐÐÀ´½øÐÐÅÅÐò - ÕâÀàËÆ SQL µÄ ORDER BY ×Ó¾äµÄ¹¦ÄÜ¡£µÚÒ»¸öÊý×éÊÇÒªÅÅÐòµÄÖ÷ÒªÊý×é¡£Êý×éÖеÄÐУ¨Öµ£©±È½ÏΪÏàͬµÄ»°£¬¾Í»á°´ÕÕÏÂÒ»¸öÊäÈëÊý×éÖÐÏàÓ¦ÖµµÄ´óС½øÐÐÅÅÐò£¬ÒÀ´ËÀàÍÆ¡£
µÚÒ»¸ö²ÎÊýÊÇÊý×飬ËæºóµÄÿһ¸ö²ÎÊý¿ÉÄÜÊÇÊý×飬Ҳ¿ÉÄÜÊÇÏÂÃæµÄÅÅÐò˳Ðò±êÖ¾£¨ÅÅÐò±êÖ¾ÓÃÓÚ¸ü¸ÄĬÈϵÄÅÅÁÐ˳Ðò£©Ö®Ò»£º
SORT_ASC - ĬÈÏ£¬°´ÉýÐòÅÅÁС£(A-Z)
SORT_DESC - °´½µÐòÅÅÁС£(Z-A)
Ëæºó¿ÉÒÔÖ¸¶¨ÅÅÐòµÄÀàÐÍ£º
SORT_REGULAR - ĬÈÏ¡£½«Ã¿Ò»Ïî°´³£¹æ˳ÐòÅÅÁС£
SORT_NUMERIC - ½«Ã¿Ò»Ïî°´Êý×Ö˳ÐòÅÅÁС£
SORT_STRING - ½«Ã¿Ò»Ïî°´×Öĸ˳ÐòÅÅÁС£
Óï·¨
array_multisort(array1,sorting order,sorting type,array2,array3...)
²ÎÊýÃèÊö
array1
±ØÐè¡£¹æ¶¨ÊäÈëµÄÊý×é¡£
sorting order
¿ÉÑ¡¡£¹æ¶¨ÅÅÁÐ˳Ðò¡£¿ÉÄܵÄÖµÊÇ SORT_ASC ºÍ SORT_DESC¡£
sorting type
¿ÉÑ¡¡£¹æ¶¨ÅÅÐòÀàÐÍ¡£¿ÉÄܵÄÖµÊÇSORT_REGULAR¡¢SORT_NUMERICºÍSORT_STRING¡£
array2
¿ÉÑ¡¡£¹æ¶¨ÊäÈëµÄÊý×é¡£
array3
¿ÉÑ¡¡£¹æ¶¨ÊäÈëµÄÊý×é¡£
 


Ïà¹ØÎĵµ£º

³õѧPHPµÄ18¸ö»ù´¡Àý³Ì

 
ÈçºÎ´´½¨ÎÒÃǵĵÚÒ»¸öPHPÒ³ÃæÄØ£¿·Ç³£¼òµ¥µÄ£¡Ñ¡ÔñÎÒÃÇʹÓõÄÒ»¸ö×îºÃµÄÉè¼Æ¹¤¾ß£¬µ±È»ÄãÒ²¿ÉÒÔ Ö»Ê¹ÓüÇʱ¾¡£´´½¨Ö®ºó¼ÇµÃÒª±£´æΪÀ©Õ¹ÃûΪPHPµÄÎļþ£¬È»ºó´«µ½ÎÒÃǵķþÎñÆ÷
ÉÏ¡£
¡¡¡¡ÔÚ±àдPHP³ÌÐò֮ǰͨ³£ÎÒÃÇÐèÒªÅäÖÃÎÒÃǵĻ·¾³£¬Ò²¾ÍÊÇ˵·þÎñÆ÷
ÒªÖ§³ÖPHP²ÅÄÜÐа¡
¡¡¡¡Ò»¡¢PHPµÄ»ù±¾½á¹¹£º
¡¡¡¡Ê¹ÓÃIncl ......

phpº¯Êýget_magic_quotes_gpcÏê½â

set_magic_quotes_runtimeÊÇÓÃÀ´ÉèÖÃPHP »·¾³ÅäÖõıäÁ¿ magic_quotes_runtime Öµ¡£
0-¹Ø±Õ 1-´ò¿ª
³ÌÐòÖмì²â״̬ÓÃget_magic_quotes_runtime,·µ»Ø 0 ±íʾ¹Ø±Õ±¾¹¦ÄÜ£»·µ»Ø 1 ±íʾ±¾¹¦ÄÜ´ò¿ª¡£Èô
magic_quotes_runtime ´ò¿ªÊ±£¬ËùÓÐÍⲿÒýÈëµÄÊý¾Ý¿â×ÊÁÏ»òÕßÎļþµÈµÈ¶¼»á×Ô¶¯×ªÎªº¬Óз´Ð±ÏßÒç³ö×Ö·ûµÄ×ÊÁÏ¡ ......

php¶ÔzipÎļþ½âѹºÍѹËõ

<?php
/**
* @author wyt
*
*/
class zip {
private $_zipObj=null;
private $_zipfcArr=array();
private $_basePath=null;
private $_zipName;
/**
* init
* @param zipÎļþÃû³Æ $zipName
*/
function __construct($zipName){
$this->_zipName=$zipName;
$this->_zipObj= ......

PHPµÄÈÕÆÚʱ¼äº¯Êýdate()

PHPµÄÈÕÆÚʱ¼äº¯Êýdate()
1£¬Äê-ÔÂ-ÈÕ
echo date('Y-m-j');
2007-02-6
echo date('y-n-j');
07-2-6
´óдY±íʾÄêËÄλÊý×Ö£¬¶øСдy±íʾÄêµÄÁ½Î»Êý×Ö£»
Сдm±íʾÔ·ݵÄÊý×Ö(´øÇ°µ¼)£¬¶øСдnÔò±íʾ²»´øÇ°µ¼µÄÔ·ÝÊý×Ö¡£
echo date('Y-M-j');
2007-Feb-6
echo date('Y-m-d');
2007-02-06
´óдM±íʾÔ·ݵÄ3¸öËõÐ´× ......

ÓÅ»¯PHP³ÌÐò

ÏÈÎÒÃÇÁ˽âÒ»ÏÂÎÒÃǵÄphp³ÌÐòÊÇÔõÑùÖ´Ðеģ¬Ê×ÏÈËû±»±àÒëΪÖмä´úÂ룬ȻºóÖмä´úÂë±»ËÍÈëÖ´ÐÐÒýÇæÖ´ÐУ¬È»ºóÏú»Ù¡£Ã¿¸öÇëÇóµÄÖмä´úÂëÔÚÖ´ÐÐÍêÖ®ºó±»Ïú»Ù£¬ÕâÑùµÄºÃ´¦ÔÚÓÚËûÍêÈ«¸ôÀëÁ˲»Í¬µÄÇëÇó£¬Ê¹ÄÚ´æʹÓÃÂʽµµÍ¡£µ«ÊÇÕâÑùµÄȱµãÒ²ÏÔ¶øÒ×¼û£¬ÒòΪËûÐèÒªÔÙÖظ´ÇëÇóÒ»¸ö½çÃæµÄʱºò¶ÔÒ»¸ö´úÂëÁ¬Ðø±àÒëÁ½´Î£¬±àÒëµÄÖмä´úÂëà ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ