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

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¸öËõд×Ö·û£¬¶øСд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±íʾ·þÎñÆ÷µÄʱ¼äÇøÓòÉèÖÃ


Ïà¹ØÎĵµ£º

phpÀïÈçºÎ°Ñ×Ö·û´®×ª»»³É×Ö·ûÊý×é

 ½â¾öµÄ°ì·¨Óкü¸¸ö£º
µÚÒ»¸öÊÇ£ºstr_split()£¬Õâ¸ö·½·¨ÊÇPHP5¼ÓÈëµÄ¡£
<?php
$str = "Hello Friend";
$arr1 = str_split($str);
$arr2 = str_split($str, 3);
print_r($arr1);
print_r($arr2);
?>
Êä³ö¾ÍÊÇ£º
Array
(
[0] => H
[1] => e
[2] => l
[3] => l
......

PHPÖÐhtmlentitiesºÍhtmlspecialcharsº¯ÊýµÄÇø±ð

×öPHP³ÌÐòµÄÈ˶¼ÖªµÀhtmlentitiesºÍhtmlspecialcharsº¯Êý£¬¶¼ÊǸñʽ»¯html´úÂëµÄ£¬µ«ÊÇÕâ¶þ¸öº¯ÊýÊÇ·ñÕæµÄ¹¦ÄÜÒ»ÑùÂ𣿠php³ÌÐòÔ±Ö®¼Ò ÕâÁ½¸öº¯ÊýÔÚ¸ñʽ»¯´øÓÐÓ¢ÎÄ×Ö·ûµÄhtml´úÂëµÄʱºò»ù±¾Ã»É¶ÎÊÌ⣬µ«ÊÇhtmlentities¶ÔÖÐÎÄ×Ö·ûÒ²²»·Å¹ý£¬ÕâÑùµÃ³öÀ´µÄ½á¹ûÊÇÖÐÎÄ×Ö·û²¿·Ö±äΪһ¶ÑÂÒÂë¡£µ±Ê±×öÓ¢ÎÄÕ¾µÄʱºò¸ù±¾¾Íû¾õ²ìµ ......

[ת]PHP ÖÐÇÉÓÃÊý×é½µµÍ³ÌÐòµÄʱ¼ä¸´ÔÓ¶È

PHP ÖÐÇÉÓÃÊý×é½µµÍ³ÌÐòµÄʱ¼ä¸´ÔÓ¶È
Íõ µ¤µ¤, ¸ß¼¶Èí¼þ¹¤³Ìʦ, IBM
2009 Äê 11 ÔÂ 26 ÈÕ
±¾ÎÄÖ÷ÒªÊǽéÉÜÔÚ PHP µÄ±à³ÌÖУ¬ÈçºÎÇÉÓÃÊý×éÀ´½µµÍÒò¶à²ãÑ­»·¶øÒýÆðµÄʱ¼ä¸´ÔӶȵÄÎÊÌâ¡£ÌرðÊǵ±³ÌÐòÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»¥Ê±£¬Óô˷½·¨À´ÓÅ»¯ÄãµÄ´úÂ룬½«»á´ø¸øÒâÏë²»µ½µÄЧ¹û¡£
ͨ³£¿ª·¢ÈËÔ±ÔÚд³ÌÐòµÄʱºò£¬ÍùÍùÊÇ°ÑÒѾ­Éè ......

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= ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ