|
 |
|
ผมติดตรงนี้มานานแล้วคับ อยากจะให้คัยที่รู้ช่วยผมดูหน่อย |
|
 |
|
|
 |
 |
|
if ($today > trDate) { // บรรทัดนี้น่า error นะครับ
|
 |
 |
 |
 |
Date :
2009-03-03 09:58:54 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันก้อไม่แจ้ง error นะคับ แล้วรูปแบบต้องเขียนยังไงคับ
|
 |
 |
 |
 |
Date :
2009-03-03 11:10:31 |
By :
cmdping |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
โค้ดก้อบมา หรือว่าทำเองครับ ที่บอกไป คุณลองดูดีๆละกัน
|
 |
 |
 |
 |
Date :
2009-03-03 11:40:10 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมก้อก็อปของคุณวินมาจากในเว็บ thaicreateนี้ละคับเพราะผมมันไม่ค่อยเป็น
|
 |
 |
 |
 |
Date :
2009-03-03 13:38:09 |
By :
cmdping |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<?php
function DateDiff($startDate,$endDate)
{
return round((strtotime($endDate) - strtotime($startDate))/ ( 60 * 60 * 24 )); // 1 day = 60*60*24
}
$today = date("Y-m-d");
$inputDate = "2009-05-01"; // as you input data
if(DateDiff($today,$inputDate) > 60)
{
// greater
}
else
{
// less
}
?>
|
 |
 |
 |
 |
Date :
2009-03-03 14:18:54 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คือว่า คุณ เอี่ยว(Rest) หมายถึง
ให้แก้โค้ดบรรทัดนี้ค่ะ
<?php
if ($today > trDate) { //มันผิด
?>
ให้แก้เป็น
<?php
if ($today > $strDate) {
?>
แล้วแก้รึยังอ่ะคะ
เหอๆ เข้าใจผิดกันไปใหญ่แล้ว

|
 |
 |
 |
 |
Date :
2009-03-03 14:27:10 |
By :
Jewels |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากนะคับสำหรับคำตอบทุกๆคำตอบและคำแนะนำ ผมจะฝึกฝนให้มากกว่านี้
|
 |
 |
 |
 |
Date :
2009-03-03 15:35:23 |
By :
cmdping |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|