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

php ʱ¼äת»¯º¯ÊýʵÀý

phpÖÐÈÕÆÚת»»º¯ÊýstrtotimeµÄÓ÷¨:
Óï·¨:
int strtotime ( string time [, int now] )
·µ»Ø½«ÈκÎÓ¢ÎÄÎı¾µÄÈÕÆÚʱ¼äÃèÊö½âÎöΪ Unix ʱ¼ä´Á
ʵÀý:
Ò»£¬»ñÈ¡Ö¸¶¨ÈÕÆÚµÄunixʱ¼ä´Á strtotime("2009-1-22") ʾÀýÈçÏ£º
echo strtotime("2009-1-22") ½á¹û£º1232553600
˵Ã÷£º·µ»Ø2009Äê1ÔÂ22ÈÕ0µã0·Ö0Ãëʱ¼ä´Á
¶þ£¬»ñÈ¡Ó¢ÎÄÎı¾ÈÕÆÚʱ¼ä ʾÀýÈçÏ£º
±ãÓڱȽϣ¬Ê¹ÓÃdate½«µ±Ê±¼ä´ÁÓëÖ¸¶¨Ê±¼ä´Áת»»³Éϵͳʱ¼ä
(1)´òÓ¡Ã÷Ìì´ËʱµÄʱ¼ä´Ástrtotime("+1 day")
µ±Ç°Ê±¼ä£ºecho date("Y-m-d H:i:s",time()) ½á¹û£º2009-01-22 09:40:25
Ö¸¶¨Ê±¼ä£ºecho date("Y-m-d H:i:s",strtotime("+1 day")) ½á¹û£º2009-01-23 09:40:25
(2)´òÓ¡×òÌì´ËʱµÄʱ¼ä´Ástrtotime("-1 day")
µ±Ç°Ê±¼ä£ºecho date("Y-m-d H:i:s",time()) ½á¹û£º2009-01-22 09:40:25
Ö¸¶¨Ê±¼ä£ºecho date("Y-m-d H:i:s",strtotime("-1 day")) ½á¹û£º2009-01-21 09:40:25
(3)´òӡϸöÐÇÆÚ´ËʱµÄʱ¼ä´Ástrtotime("+1 week")
µ±Ç°Ê±¼ä£ºecho date("Y-m-d H:i:s",time()) ½á¹û£º2009-01-22 09:40:25
Ö¸¶¨Ê±¼ä£ºecho date("Y-m-d H:i:s",strtotime("+1 week")) ½á¹û£º2009-01-29 09:40:25
(4)´òÓ¡ÉϸöÐÇÆÚ´ËʱµÄʱ¼ä´Ástrtotime("-1 week")
µ±Ç°Ê±¼ä£ºecho date("Y-m-d H:i:s",time()) ½á¹û£º2009-01-22 09:40:25
Ö¸¶¨Ê±¼ä£ºecho date("Y-m-d H:i:s",strtotime("-1 week")) ½á¹û£º2009-01-15 09:40:25
(5)´òÓ¡Ö¸¶¨ÏÂÐÇÆÚ¼¸µÄʱ¼ä´Ástrtotime("next Thursday")
µ±Ç°Ê±¼ä£ºecho date("Y-m-d H:i:s",time()) ½á¹û£º2009-01-22 09:40:25
Ö¸¶¨Ê±¼ä£ºecho date("Y-m-d H:i:s",strtotime("next Thursday")) ½á¹û£º2009-01-29 00:00:00
(6)´òÓ¡Ö¸¶¨ÉÏÐÇÆÚ¼¸µÄʱ¼ä´Ástrtotime("last Thursday")
µ±Ç°Ê±¼ä£ºecho date("Y-m-d H:i:s",time()) ½á¹û£º2009-01-22 09:40:25
Ö¸¶¨Ê±¼ä£ºecho date("Y-m-d H:i:s",strtotime("last Thursday")) ½á¹û£º2009-01-15 00:00:00
ÒÔÉÏʾÀý¿ÉÖª£¬strtotimeÄܽ«ÈκÎÓ¢ÎÄÎı¾µÄÈÕÆÚʱ¼äÃèÊö½âÎöΪUnixʱ¼ä´Á£¬ÎÒÃǽáºÏmktime()»òdate()¸ñʽ»¯ÈÕÆÚʱ¼ä»ñÈ¡Ö¸¶¨µÄʱ¼ä´Á£¬ÊµÏÖËùÐè


Ïà¹ØÎĵµ£º

ħÊÞÕù°ÔÖ®PHPÉè¼Æģʽ

 
Ç°ÑÔ£ºÎÒдµÄ¹ØÓÚÉè¼ÆģʽµÄһϵÁÐÎÄÕ¡£ÕâϵÁеÄÎÄÕÂÖ÷ÒªÕë¶Ôû½Ó´¥¹ýÉè¼ÆģʽµÄ£¬»òÕß˵½Ó´¥¹ýµ«»¹²»ÊǺÜÃ÷°×µÄPHPer¡£
ÎÊÌâµÄÌá³ö:
¿ÉÄܺܶàÈ˶¼Ð´¹ýÀ࣬Îļþ²Ù×÷µÄ£¬Êý¾Ý¿âµÄ……
¶ÔÓÚÊý¾Ý¿âµÄÀàÀ´ËµÓÐʱºò¿ÉÄܱ»ºöÂÔµÄÒ»¸öÎÊÌâÊÇ£ºÎÒÃÇ´´½¨ÀàµÄʵÀýʱһ°ã¶¼ÊÇͨ¹ý¹¹Ô캯ÊýÁ¬½ÓÁËÊý¾Ý¿â¡£Õâû´ ......

phpͳ¼ÆIPÒÔ¼°ÔÚÏßÈËÊýµÄͳ¼Æ

    1.ÓÃJSµ÷ÓÃÎļþcount.php  ÔÚÄãÐèÒª¼ÓÈëͳ¼ÆµÄµÄµØ·½¼ÓÈë<script src="count.php"></script>  ʵ¼ÊÔËÓÃÖÐ×¢ÒâÐ޸ķ¾¶£¡
  
     2.php»·¾³±ØÐëÖ§³Öputenv()º¯Êý,¿ÉÒÔͳ¼Æ×òÈÕ·ÃÎÊ£¬½ñÈÕ·ÃÎÊ£¬ÔÚÏßÈËÊý,Äú·ÃÎʵĴÎÊý¡£
    3 . ......

ͶÈëµÄphpµÄ»³±§

 Ô­À´ÊÇѧjspµÄ£¬µ«ÊǸоõjspÌ«ÄÑÁË£¬¶øÇÒ·¢ÏÖ£¬ÏÖÔڱȽÏÁ÷ÐÐphpÁË£¬php+mysqlµÄ»Æ½ð´îµµ¡£
 ¿´jspµÄÊéʱ£¬ÊéÉÏ˵£¬jsp±ÈphpºÃ£¬ÏÖÔÚ¿´phpµÄÊ飬˵php±ÈjspºÃ£¬ÎÒÏëÕâÒ²ÊÇÖÇÕß¼ûÖÇ£¬ÈÊÕß¼ûÈÊ°É¡£
 ÇìÐÒ×Ô¼ºÑ§php·¢ÏÖÁËÒ»±¾ºÃÊ飬ÍƼö¸ø´ó¼Ò£¬¾ÍÊǽ²µÄºÜÏêϸ¡£
 Ó¢ÎÄÃû¡¶PHP and MySQL EXAMPLE¡· ÃÀ¹ ......

PHPºÍJavascriptµÄJSON½»»¥£¨´¦ÀíÒ»¸ö¶þάÊý×飩

 
PHPµÄJSONÀà¿âÎÒʹÓõÄÊÇServices_JSON
£¬Ã»Ê²Ã´ÌرðµÄÓŵ㣬ҲûʲôÃ÷ÏÔµÄȱµã£¬¶Ô¸¶ÓÃ×ãÒÓ¡£
½¨Á¢Îļþdata.php
£º
<?php
include(
"JSON.php"
);
$data
= array(
    
array(
'name'
=>
mb_convert_encoding
(
'ÀÏÍõ'
,
'UTF-8'
,
'GBK'
), ......

PHPÖо­³£Óõ½µÄ¼¸¸öÈ¡Õûº¯Êý

ÕûµÄº¯Êý£¬½ñÌìССµÄ×ܽáһϣ¡ÆäʵºÜ¼òµ¥£¬¾ÍÊǼ¸¸öº¯Êý¶øÒÑ¡«¡«Ö÷ÒªÊÇ£ºceil£¬floor£¬round£¬intval
ceil -- ½øÒ»·¨È¡Õû
˵Ã÷
float ceil ( float value )
·µ»Ø²»Ð¡ÓÚ value µÄÏÂÒ»¸öÕûÊý£¬value Èç¹ûÓÐСÊý²¿·ÖÔò½øһλ¡£ceil() ·µ»ØµÄÀàÐÍÈÔÈ»ÊÇ float£¬ÒòΪ float ÖµµÄ·¶Î§Í¨³£±È integer Òª´ó¡£
Àý×Ó 1. ceil ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ