|
 |
|
แจกฟังชั่นนับเวลาวันสิ้นโลกปี 2012 จากเผ่ามายันไม่เชื่อแต่อย่าลบหลู่ เขียนโปรแกรมอย่าเครียดเกินไปครับ |
|
 |
|
|
 |
 |
|
Code (PHP)
<meta http-equiv="Content-Type" content="text/html; charset=utf-8;">
<?php
function count_day($dmy1,$dmy2,$type=null){
$dmy1 = explode("-",$dmy1);
/* วันเดือนปี ชุดเริ่มต้น*/
$day1 = $dmy1[0];
$moth1 = $dmy1[1];
$year1 = $dmy1[2];
$dmy2 = explode("-",$dmy2);
/* วันเดือนปี ชุดจบ*/
$day2 = $dmy2[0];
$moth2 = $dmy2[1];
$year2 = $dmy2[2];
$result_1 = mktime(0, 0, 0, $moth1, $day1, $year1);
$result_2 = mktime(0, 0, 0, $moth2, $day2, $year2);
$result_date = $result_2 - $result_1;
$result = $result_date / (60 * 60 * 24);
return $result+$type;
}
$date_ = date("d-m-Y");//วันที่ปัจจุบัน
echo "คุณเหลือเวลาในโลกอยู่ <b>".count_day($date_,"15-12-2012")."</b>วัน ตามปฎิิธินเผ่ามายัน";
?>
Tag : PHP

|
|
 |
 |
 |
 |
Date :
2012-01-14 04:04:58 |
By :
workbythai dot com |
View :
872 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

+1 ในความตั้งใจครับ
|
 |
 |
 |
 |
Date :
2012-01-14 20:57:41 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|