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

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¸öËõд×Ö·û£¬¶øСдmÔò±íʾÔ·ݵÄÊý×Ö(´øÇ°µ¼0);
ûÓдóдµÄJ£¬Ö»ÓÐСдj±íʾÔ·ݵÄÈÕÆÚ£¬ÎÞÇ°µ¼o£»ÈôÐèÒªÔ·ݴøÇ°µ¼ÔòʹÓÃСдd¡£
echo date('Y-M-j');
2007-Feb-6
echo date('Y-F-jS');
2007-February-6th
´óдM±íʾÔ·ݵÄ3¸öËõд×Ö·û£¬¶ø´óдF±íʾÔ·ݵÄÓ¢ÎÄȫд¡£(ûÓÐСдf)
´óдS±íʾÈÕÆڵĺó׺£¬±ÈÈç“st”¡¢“nd”¡¢“rd”ºÍ“th”£¬¾ßÌå¿´ÈÕÆÚÊý×ÖΪºÎ¡£
С½á£º
±íʾÄê¿ÉÒÔÓôóдµÄYºÍСдy;
±íʾÔ¿ÉÒÔÓôóдF¡¢´óдM¡¢Ð¡Ð´mºÍСдn(·Ö±ð±íʾ×Ö·ûºÍÊý×ÖµÄÁ½ÖÖ·½Ê½);
±íʾÈÕ¿ÉÒÔÓÃСдdºÍСдj£¬´óдS±íʾÈÕÆڵĺó׺¡£
2£¬Ê±:·Ö:Ãë
ĬÈÏÇé¿öÏ£¬PHP½âÊÍÏÔʾµÄʱ¼äΪ“¸ñÁÖÍþÖαê׼ʱ¼ä”£¬ÓëÎÒÃDZ¾µØµÄʱ¼äÏà²î8¸öСʱ¡£
echo date('g:i:s a');
5:56:57 am
echo date('h:i:s A');
05:56:57 AM
Сдg±íʾ12СʱÖÆ£¬ÎÞÇ°µ¼0£¬¶øСдhÔò±íʾÓÐÇ°µ¼0µÄ12СʱÖÆ¡£
µ±Ê¹ÓÃ12СʱÖÆʱÐèÒª±íÃ÷ÉÏÏÂÎ磬Сдa±íʾСдµÄ“am”ºÍ“pm”£¬´óдA±íʾ´óдµÄ“AM”ºÍ“PM”¡£
echo date('G:i:s');
14:02:26
´óдG±íʾ24СʱÖƵÄСʱÊý£¬µ«ÊDz»´øÇ°µ¼µÄ£»Ê¹ÓôóдµÄH±íʾ´øÇ°µ¼µÄ24СʱÖÆСʱÊý
С½á£º
×Öĸg±íʾСʱ²»´øÇ°µ¼£¬×Öĸh±íʾСʱ´øÇ°µ¼£»
Сдg¡¢h±íʾ12СʱÖÆ£¬´óдG¡¢H±íʾ24СʱÖÆ¡£
3£¬ÈòÄê¡¢ÐÇÆÚ¡¢Ìì
echo date('L');
½ñÄêÊÇ·ñÈòÄ꣺0
echo date('l');
½ñÌìÊÇ£ºTuesday
echo date('D');
½ñÌìÊÇ£ºTue
´óдL±íʾÅжϽñÄêÊÇ·ñÈòÄ꣬²¼¶ûÖµ£¬ÎªÕæ·µ»Ø1£¬·ñÔòΪ0£»
Сдl±íʾµ±ÌìÊÇÐÇÆÚ¼¸µÄÓ¢ÎÄȫд(Tuesday)£»
¶øʹÓôóдD±íʾÐÇÆÚ¼¸µÄ3¸ö×Ö·ûËõд(Tue)¡£
echo date('w');
½ñÌìÐÇÆÚ£º2
echo date('W');
±¾ÖÜÊÇÈ«ÄêÖÐµÄµÚ 06 ÖÜ
Сдw±íʾÐÇÆÚ¼¸£¬Êý×ÖÐÎʽ±íʾ
´óдW±íʾһÄêÖеÄÐÇÆÚÊý
echo date('t');
±¾ÔÂÊÇ 28 Ìì
echo date('z');
½ñÌìÊǽñÄêµÄµÚ 36 Ìì
Сдt±íʾµ±Ç°Ô·ÝÓÖ¶àÉÙÌì
Сдz±íʾ½ñÌìÊDZ¾ÄêÖеڼ¸Ìì
4£¬ÆäËû
echo date('T');
UTC
´óдT±íʾ·þÎñÆ÷µÄʱ¼äÇøÓòÉèÖÃ
echo date('I');
0


Ïà¹ØÎĵµ£º

PHP·ÖÒ³¼¼Êõ

 
1¡¢Ç°ÑÔ
¡¡¡¡·ÖÒ³ÏÔʾÊÇÒ»Öַdz£³£¼ûµÄä¯ÀÀºÍÏÔʾ´óÁ¿Êý¾ÝµÄ·½·¨£¬ÊôÓÚweb±à³ÌÖÐ×î³£´¦ÀíµÄʼþÖ®Ò»¡£¶ÔÓÚweb±à³ÌµÄÀÏÊÖÀ´Ëµ£¬±àдÕâÖÖ´úÂëʵÔÚÊǺͺôÎüÒ»Ñù×ÔÈ»£¬µ«ÊǶÔÓÚ³õѧÕßÀ´Ëµ£¬³£³£¶ÔÕâ¸öÎÊÌâÃþ²»×ÅÍ·Ð÷£¬Òò´ËÌصØ׫д´ËÎĶÔÕâ¸öÎÊÌâ½øÐÐÏêϸµÄ½²½â£¬Á¦ÇóÈÿ´ÍêÕâƪÎÄÕµÄÅóÓÑÔÚ¿´ÍêÒÔºó¶ÔÓÚ·ÖÒ³ÏÔʾµÄÔ­ ......

Mysql¡¢Apache¡¢PhpµÄжÔØ (Linux)

 Ð¶ÔØMysql
[root@localhost ~]# rpm -qa | grep mysql
mysql-3.23.58-9
php-mysql-4.3.4-11
mod_auth_mysql-20030510-4.1
mysql-server-3.23.58-9
˵Ã÷£ºrpm –qa | grep mysql ÃüÁîÊÇΪÁË°ÑmysqlÏà¹ØµÄ°ü¶¼ÁгöÀ´£¬Ð¶Ôض¼´Ó×îÏÂÃæµÄÒ»¸ö°ü¿ªÊ¼£¬Ö±µ½Ð¶ÔصôµÚÒ»¸öΪֹ¡£Ö´ÐÐrpm -q php£¬Èç¹û·µ»Øphp°æ±¾£¬ ......

PHPÂëÅ©½ø»¯Ê·4


1.echo();2.print();3.die();4.printf();5.sprintf();6.print_r;7.var_dump();
1.echo()
Êä³ö¶à¸ö×Ö·û´®£¬¿ÉÒÔ¶à¸ö²ÎÊý£¬²»ÐèÒªÔ²À¨ºÅ£¬ÎÞ·µ»ØÖµ¡£
2.print()
Ö»ÄÜÊä³öÒ»Ñù¶«Î÷£¬ÐèÒªÔ²À¨ºÅ£¬Óзµ»ØÖµ£¬Ö´ÐÐʧ°ÜÊÇ·µ»Øflase.
3.die()
Êä³öÄÚÈÝ£¬Í£Ö¹³ÌÐò¡£*¶àÓÃÓÚÊý¾Ý¿âµÄÁ´½Óʱ£¬¼ìÑéÊÇ·ñ³ö´í¡£
4.printf()
prin ......

PHPÂëÅ©½ø»¯Ê·5

1.ËùÓеÄÊý¾Ý¶¼Ó¦¸ÃÒþ²ØÔÚËùÔÚµÄÀàµÄÄÚ²¿¡£
2.ÀàµÄʹÓÃÕß±ØÐëÒÀÀµÀàµÄ¹«¹²½Ó¿Ú£¬µ«À಻ÄÜÒÀÀµËûµÄʹÓÃÕß¡£
3.¾¡Á¿¼õÉÙÀàЭÒéÖеÄÏûÏ¢¡£
4.ʵÏÖËùÓÐÀ඼Àí½âµÄ×î»ù±¾µÄ½Ó¿Ú¡££¨¿½±´²Ù×÷£¬°üÀ¨É±´ºÍdz¿½±´£©£¬ÏàµÈÐÔÅжϣ¬ÕýÈ·Êä³öÄÚÈÝ£¬´ÓASC2ÃèÊö½âÎöµÈµÈ¡£
5.²»°ÑʵÏÖϸ½ÚÈç·ÀÖ¹¹«¹²´úÂëµÄ˽Óк¯Êý.·Åµ½ÀàµÄ¹²Óнӿ ......

¼¸¸ö PHP Îļþ¶Áдº¯ÊýºÍ CSVFileObject Àà

/**
* ´ò¿ª¹Ø±ÕÎļþ
*/
fopen() // 2/4: 2 ¸ö±ØÑ¡²ÎÊý£¬ 4 ¸ö²ÎÊý;
fclose() // 1/1;
/**
* ¶ÁÈ¡Îļþ
*/
// ÐèÏÈÓà fopen() ´ò¿ªÎļþ²ÅÄܶÁÈ¡µÄº¯Êý£»´ÓÎļþÖ¸Õë´¦¿ªÊ¼¶ÁÈ¡
fgetc() // 1/1; ¶ÁÈ¡Ò»¸ö×Ö·û
fgets() // 1/2; ¶ÁÈ¡Ò»ÐÐ
fgetss() // 1/3; ¶ÁÈ¡Ò»Ðв¢È¥³ý HMTL ±êÇ©
fgetcsv() // 1/5; ¶ÁÈ¡Ò»Ðв ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ