PHP³£Óú¯Êý(1)
ÔÎÄÁ´½Ó£ºhttp://www.phpdo.net/index.php/2010/02/11/1-14/
PHPÖлñµÃÈÕÆÚʱ¼äÐÅÏ¢µÄº¯Êý——Getdate
ʱ¼ä´Á:°üº¬ÁË´ÓunixмÍÔª£¨1970Äê1ÔÂ1 ÈÕÁãʱ£©µ½¸ø¶¨Ê±¼äµÄÃëÊý£¬ÊÇÒ»¸ö³¤ÕûÊý¡£
Getdateº¯Êý¾ÍÊÇÓÃÀ´»ñµÃµ±Ç°Ê±¼ä£¬»òÕßÓÃÀ´·ÖÎöʱ¼ä´ÁµÄ¾ßÌåÒâÒå¡£Óï·¨£º
Array getdate([int timestamp])
º¬Ò壺timestampÊÇÒ»¸ö°üº¬ÓÐÈÕÆÚʱ¼äÐÅÏ¢µÄÊý×飬getdateº¯Êý»áµÃµ½Ò»¸ö·µ»ØÖµ£¬Ä¬ÈÏÊǵ±Ç°Ê±¼ä£¬°üÀ¨ÈÕÆÚºÍʱ¼äµÄÍêÕûµÄÐÅÏ¢¡£
Getdateº¯Êý·µ»ØµÄÊý×é¼üÖµ
¼üÖµ
˵Ã÷
¼üÖµ
˵Ã÷
Seconds
ÃëµÄÊý×Ö±íʾ
Minutes
·ÖÖÓµÄÊý×Ö±íʾ
Hours
СʱµÄÊý×Ö±íʾ
Mday
Ô·ÝÖеĵڼ¸ÌìµÄÊý×Ö±íʾ
wday
ÐÇÆÚÖеĵڼ¸ÌìµÄÊý×Ö±íʾ
mon
Ô·ݵÄÊý×Ö±íʾ
year
ÄêµÄÊý×Ö±íʾ
yday
Ò»ÄêÖеĵڼ¸ÌìµÄÊý×Ö±íʾ
weekday
ÐÇÆÚ¼¸µÄÍêÕûÎı¾±íʾ
month
Ô·ݵÄÍêÕûÎı¾±íʾ
0
×Ô´ÓUnix¼ÍÔª¿ªÊ¼ÖÁ½ñµÄÃëÊý
ÀýÈ磺
<?php
$today = getdate(); //ÍêÕûµÄʱ¼äÐÅÏ¢
print_r($today);
echo “½ñÌìÊǽñÄêµÄµÚ”.$today['yday'].”Ìì”;
?>
½á¹û£º
Array ( [seconds] => 25 [minutes] => 49 [hours] => 5 [mday] => 11 [wday] => 4 [mon] => 2 [year] => 2010 [yday] => 41 [weekday] => Thursday [month] => February [0] => 1265867365 ) ½ñÌìÊǽñÄêµÄµÚ41Ìì
PHPÖлñµÃµ±Ç°Ê±¼äµÄº¯Êý——gettimeofday
PhpÖÐÒý½øÁËgettimeofdayº¯Êý£¬ÓÃÓÚ½â¾ögetdateº¯ÊýÖ»Äܾ«È·µ½ÃëµÄÒź¶£¬gettimeofdayº¯Êý¿ÉÒÔ¾«È·µ½Î¢Ãî¡£Óï·¨£º
¡¡Array gettimeofday(void)
Gettimeofdayº¯Êý·µ»ØµÄÊý×飬°üº¬ÓÐÈçÏÂÊý¾Ý£º
Sec£º ×Ô´ÓUnix¼ÍÔª¿ªÊ¼ÖÁ½ñµÄÃëÊý£»
Usec£ºÎ¢ÃîÊý£»
Minuteswest£º¸ñÁÖÍþÖÎÏòÎ÷µÄ·ÖÖÓÊý£»
Dsttime£ºÏÄÁîʱÐÞÕýµÄÀàÐÍ¡£Èç¹ûÊÇÏÄÁîʱÔòΪ1£¬·ñÔòΪ0.
ÀýÈ磺
<?php
$today = getdate();
echo $today[0].”\n”; //Êä³öÃëÊý
$today = gettimeofday();
print_r($today); //Êä³ö½ñÌìµÄÏêϸÐÅÏ¢
?>
½á¹û£º
1265869037
Array ( [sec] => 1265869037 [usec] => 515628 [minuteswest] => 0 [dsttime] => 0 )
PHPÖÐÈÕÆÚÑéÖ¤º¯Êý——checkdate
Checkdateº¯ÊýÓÃÀ´ÑéÖ¤Ò»¸öÈÕÆÚÊÇ·ñÓÐЧ¡£Óï·¨£º
¡¡Bool checkdate(int month,int day,int year)
Èç
Ïà¹ØÎĵµ£º
ÔÚÕ⼸ÌìµÄ¹¤×÷¹ý³ÌÖУ¬ÐèҪʵÏÖPHPÔÚ·þÎñÆ÷¶ËÄÜÓëÆäËû³ÌÐòͨÐÅ¡£ºÍÀϺÎÁ©ÈËÑо¿ÁË°ëÌ죬ÖÕÓÚ´óÖÂŪ³öÁËÒ»¸öÓÃWINDOWSµÄÃüÃû¹ÜµÀͨÐŵķ½·¨¡£
Óм¸µãÐèҪעÒâµÄ£º
PHP·þÎñÆ÷¶ËÎÒÃÇÿ´Î¶¼ÊÇÖØйҽÓÃüÃû¹ÜµÀ¡££¨ÕâÑùд£¬PHP¶Ë´úÂëÁ¿¼«ÆäÉÙ£¬¶øÇÒÒ²ºÜ·½±ã¡££©
ÄÇôÎÒÃÇÓÃC/C++дµÄÃüÃû¹ÜµÀ·þÎñÆ÷ÔòÐèҪÿ´ÎͨÐŶ¼´´½¨Ò»´Î¹ ......
/*
author: yangyu@sina.cn
description: ½»»»Êý×éÖÐÁ½¸öÔªËصÄλÖã¬ÔªËØ°üÀ¨keyºÍvalue£¬¾ßÌåÓ÷¨¼ûÏÂÃæµÄÀý×Ó
*/
$arr = array(11=>'a',22=>'b',33=>'c',44=>'d');
$res = array_exchange($arr, 11 ,33);
//example:
echo '<pre>';print_r ($res);echo '</pre>';
function array_excha ......
±¾ÎÄÐèÒªÄãÒѶÔGearmanÓиö´óÖÂÁ˽⣬Èç¹û²»Öª¸Ã¶«¶«ÊǺÎÎÇë²Î¿¼Ö®Ç°Ò»Æª×ªÌûÈÕÖ¾¡¶Gearman - ·Ö²¼Ê½Ô¶³Ì¹ý³Ì´¦Àí¿ò¼Ü¡·
˳±ãÔÙÍƼöÁ½Æª²Î¿¼ÎÄÕÂ
http://hi.baidu.com/thinkinginlamp/blog/item/ff49972b9e7378f3e6cd40aa.html
£¨Ñ§Ñ§Gearman£©
http://www.ibm.com/developerworks/cn/opensource/os-php-gearman/ind ......
Á·ÇÙµÄʱºò°ÑRIFF½Ð×öÒ»¸öÇú×ÓµÄСƬ¶Î£¬ÄÇôÎÒ×Ô¼º¶¨ÒåһϳÌÐòµÄRIFF¾ÍÊÇһС¶Î³ÌÐò°É£¬·ÅһЩÕ⼸Ìì×Ô¼ºÐ´µÄ£¬ÒÔºóÒ²³¤ÆÚ¸üУ¬×÷Ϊ×Ô¼º»ýÀۺͽñºó±à³ÌµÄ²Î¿¼¡£
1. ¸ñʽ»¯ÍøÖ·£¬ÈôûÓÐHTTPÍ·Ôò²åÈëHTTPÍ·
<?php
//add http head to url
function AddHttpHead( &$s )
{
$exist = strstr( $s,"http://" ......
GoogleΪȫÇòÖ÷Òª³ÇÊÐÌṩÁËͳһµÄÌìÆøÔ¤±¨Êý¾Ý´æ´¢¸ñʽ£¬ÄǾÍÊÇXML¡£ËùÓеĿª·¢Õ߶¼¿ÉÒÔÀûÓÃ×Ô¼ºÏ²»¶µÄÓïÑÔÀ´½âÎöXML»ñÈ¡ËùÐè³ÇÊеÄÌìÆøÔ¤±¨£¬±¾ÎĽ«½éÉÜÀûÓÃPHPÀ´»ñÈ¡ÎÒËùÔÚ³ÇÊмÃÄϵÄÌìÆøÔ¤±¨¡£
ÔÎļû±¾ÈËÍøÕ¾¡¾PHP̽·Õß¡¿
ÔÎÄÁ´½Ó£º
PHP5 ¶ÁÈ¡Google ÌìÆøÔ¤±¨XML API ......