ציטוט:
נכתב במקור על ידי Cream
PHP קוד:
$now_hour = date("H");
$next_hour = 0;
if ($now_hour == 13 || $now_hour == 14)
{
$next_hour = 15;
}
if ($now_hour == 16 || $now_hour == 17)
{
$next_hour = 18;
}
if ($now_hour == 19 || $now_hour == 20)
{
$next_hour = 21;
}
if ($now_hour == 22 || $now_hour == 23)
{
$next_hour = 24;
}
if ($now_hour == 01 || $now_hour == 02)
{
$next_hour = 3;
}
if ($now_hour == 04 || $now_hour == 05)
{
$next_hour = 6;
}
if ($now_hour == 07 || $now_hour == 08)
{
$next_hour = 9;
}
if ($now_hour == 10 || $now_hour == 11)
{
$next_hour = 12;
}
נראה לי זה מה שאתה רוצה...
אבל מה לגבי אם עכשיו שעה 12 או 15? מה אתה רוצה שזה יעשה?
בכל מקרה לכל IF אתה יכול להוסיף ELSE וזה יפעל במידה ועכשיו אחת מהשעות שאתה רוצה...
עריכה:
================
קיצר עכשיו בדקתי וזה עובד...
|
כן זה מה שאני רוצה אבל יש לי בעיות עם מספר שעות מסוימות :\