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

PHP Ϊʲôfunction


PHP Ϊʲôfunction ÔÚÉùÃ÷ʱûÓÐÉùÃ÷²ÎÊý,¶øµ÷ÓÃʱ¼ÓN¸ö²ÎÊýÈ´ÊÇÔÊÐíµÄ
2008-11-13 20:14:38    ÆäËû |  ÆÀÂÛ(7) |  ä¯ÀÀ(721)
ÈçÌâ
//ÉùÃ÷
function test(){};
$a = '';
$b = '';
$c = '';
//µ÷ÓÃ
test($a,$b,$c,1,2,3);
ÏàÐŲ»ÉÙÐֵܽãÃÃÒ²Ôø¾­Óöµ½Í¬ÑùµÄÎÊÌâ¡£
why?
¸Õ¿ªÊ¼ÎÒҲͦÓôÃÆ£¬ºó·­ÁË·­ÊÖ²áÕÒµ½ÁË´ð°¸
--------------------------------------
PHP supports passing arguments by value (the default), passing by reference, and default argument values. Variable-length argument lists are also supported, see also the function references for func_num_args(), func_get_arg(), and func_get_args() for more information.
---------------------------------------------
Ô­À´PHPÖ§³Ö±ä³¤²ÎÊýÁÐ±í£¨Variable-length argument lists £©
int func_num_args(void)¿ÉÒԵõ½²ÎÊý³¤¶È
such as:
function test()
{
    echo func_num_args();
}
test(0, 1, 2, 3); // ÏÔʾ: 4
mixed func_get_arg(int $arg_num)¿ÉÒԵõ½Ò»¸ö²ÎÊýÖµ
such as:
function test()
{
    echo func_get_arg(2);
}
test('a', 'b', 'c'); //ÏÔʾ£ºc
array func_get_args(void) ¿ÉÒԵõ½Ò»×éarray²ÎÊý
such as:
function test()
{
    var_dump(func_get_args());
}
test('a', 'b', 'c'); //ÏÔʾ£ºarray(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" }
PS£ºÓÐÎÊÌâ? ÏÈ·­ÊÖ²á°É ^_^


Ïà¹ØÎĵµ£º

ÎÞ·¨ÔØÈë mysql À©Õ¹£¬Çë¼ì²é PHP ÅäÖá­¡­½â¾ö°ì·¨

PS:ÎÒ½ñÌìÅäÖà ·þÎñÆ÷µÄʱºò³öÏÖµÄÎÊÌâ¾ÍÊÇÕâ¸ö£¬µ«ÊÇÕÕ×Å·½·¨¶¼×öÁË£¬Ñ¾µÄ¡£¡£»¹ÊÇûÓ㬼«¶ÈÓôÃÆËÀ¡£¡£°¥¡£¡£¡£ÎÒÒ²²»ÖªµÀʲôԭÒòÄØ¡£¡£¿ÉÄܵÄÔ­Òò¶¼ÕÒ¹ýÁË¡£¡£ÓôÃÆ°¡`~
apache2+mysql+php5+phpmyadminÅäÖÃÎÊÌ⣺ÎÞ·¨¼ÓÈëmysqlÀ©Õ¹£¬Çë¼ì²éphpÅäÖÃ...
°²×°Íêapache2+mysql+php5ºó£¬°²×°phpmyadmin²¢ÅäÖúÃÒÔºó£¬ÔÚä¯À ......

PHPÖÐÎĽØÈ¡£¬UTF8ºÍGBKÏê½â

 
 ÖÐÎÄ×Ö·û½ØÈ¡ÊÇÒ»¸öÊ®·ÖÓÐÓõŦÄÜ£¬ÔںܶàµØ·½¶¼»áÓõ½£¬±ÈÈçÌáÈ¡¶¨³¤±êÌ⣬³éÈ¡±êÇ©µÈ
ÓÉÓÚ¸÷ÖÖ×Ö·û¼¯µÄ´æ´¢·½Ê½µÄ²»Ò»Ñù£¬´æÔÚË«×Ö½Ú£¨GBK£©¶à×Ö½Ú£¨Unicode£©µÄ´æ´¢·½Ê½£¬Õâ¾Íµ¼ÖÂÁËͳһ´¦ÀíµÄÀ§ÄÑ¡£
¹ú¼Ê±ê×¼UTF8×Ö·û±àÂëÖУ¬´æ´¢ÖÐÎÄ×Ö·ûÒª3¸ö×Ö½Ú£¬¼´°ÑphpÎļþ´æ´¢ÎªUTF8±àÂë¸ñʽ¿ÉÒԵõ½
strlen(& ......

PHP mysqlÊÂÎñ´¦Àí »Ø¹ö²Ù×÷

MYSQLÖÐÖ»ÓÐINNODBºÍBDBÀàÐ͵ÄÊý¾Ý±í²ÅÄÜÖ§³ÖÊÂÎñ´¦Àí£¡ÆäËûµÄÀàÐÍÊDz»Ö§³ÖµÄ£¡
$lnk = mysql_connect("localhost", "root", "");
mysql_select_db("test");
mysql_query("BEGIN");
$query = mysql_query("INSERT INTO test VALUES(1, 'yangjun')&quo ......

phpÁ¬½ÓaccessµÄÀà

<?php
/*
 * Created on 2008-10-25
 *
 * developer by Alex.do QQ:20779512
 * PHP 5.0
 */
 class mdbClass {
    var $dbPath = 'database/#123123#.mdb';    //Êý¾Ý¿â·¾¶
    var $tabName;     & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ