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

PHPÊý×麯Êý


½«Ò»¸ö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()


function odd($var) {
   return ($var % 2 == 1);
}

function even($var) {
   return ($var % 2 == 0);
}

$array1 = array ("a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5);
$array2 = array (6, 7, 8, 9, 10, 11, 12);

echo "Odd :n";
print_r(array_filter($array1, "odd"));
echo "Even:n";
print_r(array_filter($array2, "even"));
?>
array_map() ½«»Øµ÷º¯Êý×÷Óõ½¸ø¶¨Êý×éµÄµ¥ÔªÉÏ£¬ËüµÄ²ÎÊý¿ÉÒÔÊÇÒ»¸öÊý×飬Ҳ¿ÉÒÔÊǶà¸öÊý×飬»Øµ÷º¯ÊýµÄ²ÎÊý±ØÐëÒªºÍµ÷ÓÃËüµÄ²ÎÊýÏàͬ¡£

//µ¥¸ö²ÎÊýµÄÀý×Ó£¬½«Êý×éÖеÄÿ¸öÖµ£¬³ËÒÔËüµÄ3´Î·½
function cube($n) {
   return $n*$n*$n;
}

$a = array(1, 2, 3, 4, 5);
$b = array_map("cube", $a);
print_r($b);
?>

//¶à¸öÊý×é²ÎÊýµÄÀý×Ó

function show_Spanish($n, $m) {
   return "The number $n is called $m in Spanish";
}

function map_Spanish($n, $m) {
   return array ($n => $m);
}

$a = array(1, 2, 3, 4, 5);
$b = array("uno", "dos", "tres", "cuatro", "cinco");

$c = array_map("show_Spanish", $a, $b);
print_r($c);
$d = array_map("map_Spanish", $a , $b);
print_r($d);
?>
//Êä³ö½á¹û
// printout of $c
Array
(
    [0] => The number 1 is called uno in Spanish
    [1] => The number 2 is called dos in Spanish
    [2] => The number 3 is called tres in Spanish
    [3] => The number 4 is called cuatro in Spanish
    [4] => The number 5 is called cinco in Spanish
)
array_multisort£¨£© ¶Ô¶à¸öÊý×é»ò¶àάÊý×é½øÐÐÅÅÐò
¿ÉÒÔÓÃÀ´Ò»´Î¶Ô¶à¸öÊý×é½øÐÐÅÅÐò»òÕ߸ù¾Ýijһά¶Ô¶àάÊý×é½øÐÐÅÅÐò¡£ÅÅÐòʱ±£ÁôÔ­ÓеļüÃû¹ØÁª£¬ÊµÏֵŦÄܺÍSQL


Ïà¹ØÎĵµ£º

Ê®Ììѧ»áphpÖ®µÚÁùÌì

 
¡¡¡¡Ñ§Ï°Ä¿µÄ£ºÑ§»áÌí¼Óɾ³ýÐÞ¸ÄÊý¾Ý
¡¡¡¡mysql_query($exec);
¡¡¡¡µ¥Õâ¸öÓï¾ä¾Í¿ÉÒÔÖ´ÐÐËùÓеIJÙ×÷ÁË£¬²»Í¬µÄ¾ÍÊÇ$execÕâ¸ösqlÓï¾ä
¡¡¡¡Ìí¼Ó£º$exec="insert into tablename (item1,item2) values ('".$_POST['item1']."',".$_POST['item1'].")";
¡¡¡¡É¾³ý£º$exec="delete from tablename where...";
¡¡¡¡ÐÞ¸ ......

phpÎļþÉÏ´«¼òµ¥Ê¾Àý

<?php
/*
Å׸öש£¬¾ßÌåÒª×ö³ÉʲôÑù×Ô¼º×ö¡£
*/
if(isset($_FILES['userfile']['tmp_name'])){
$userfile = $_FILES['userfile']['tmp_name']; //±£´æÔÚϵͳµÄÁÙʱλÖÃ
$userfile_name = $_FILES['userfile']['name'];//ÎļþÃû
$userfile_size = $_FILES['userfile'][ ......

phpÃæÏò¶ÔÏóµÄ»ù´¡

£±,ÀàµÄ½á¹¹ÉùÃ÷·½Ê½£º
¡¡¡¡ class ÀàÃû {
               //ÀàÌå
      }
£²£¬ÊôÐԺͷ½·¨µÄ¶¨Ò壻
¡¡¡¡Ê¹Óù¹Ô캯Êý£º
¡¡¡¡Ê¹ÓÃÎö¹¹º¯Êý£º
¡¡¡¡ÀàµÄʵÀý»¯£º
£³,¿ØÖÆ·ÃÎÊȨÏÞ£ºpublic , private protected;
£´ ......

phpÀ©Õ¹°²×°soapÄ£¿é





Ê×ÏȰ²×°Íê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
Îļþ± ......

ÓÃVIM×öPHP¿ª·¢»·¾³



ÀÏÁÎÔø¾­ÔÚPHPERÔÓÖ¾ÉÏ·¢±í¹ýһƪÎÄÕ½Ð×öÓÃVIM×öPHP¿ª·¢»·¾³,ÔÚÀïÃæÏêϸ½éÉÜÁËÓÃVIM×öphp¿ª·¢ÐèÒª×öµÄ×¼±¸,ÕâÆªÎÄÕ¾ͽáºÏһЩ×ÊÁϺÍÎÒ×Ô¼ºµÄһЩ¾­ÑéÀ´½éÉÜÏÂÓÃVIM×öC/C++¿ª·¢ÐèÒª×öµÄÊÂÇé,Ïà¶ÔÀ´ËµÒª±È×öphp¿ª·¢·½±ãЩ¡£
ǰÌáÌõ¼þÊǵ±È»ÊÇÄãÒѾ­ÏÂÔØÁËVIM,Èç¹ûûÓеϰÇëÏȵ½¹Ù·½ÍøÕ¾ÏÂÔØ×îа汾,µØÖ·ÊÇ£ºhttp:/ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ