date() function

A

Anonymous

Guest
im tring to create this script that.. if today is the 20 then echo this.. but if its not the 20 then echo else... but i cant get it ..

Code:
<?php

$today = date("l, j, y");
$start = date("monday, 20, 03");
echo $today;

if($today == $start){
 echo "<Br>YaY the day has come!";
}else{
   echo "<Br>You have to wait till the 20th to access this code";
}


?>

can anyone tell me how do i go by this.. thanx
 
ahh i c what your saying.. ok thanx.. i will search the manual .. and i think you have to use.. stcmp() to compare the strings.. but anyways.. i will go and check.. thanx
 
Hi!
If you want what i'm solve youre problemdo next:
Code:
<?php

$today = date("l, j, y");
$start = date("Monday, 20, 03");
echo $today;

if($today == $start){
 echo "<Br>YaY the day has come!";
}else{
   echo "<Br>You have to wait till the 20th to access this code";
}


?>

or this:
Code:
<?php

$today = date("l, j, y");
$start = ("Monday, 20, 03");
echo $today;

if($today == $start){
 echo "<Br>YaY the day has come!";
}else{
   echo "<Br>You have to wait till the 20th to access this code";
}


?>

P.S. you no need about timestamp cause you compare simple string :!: :wink:
 
Back
Top