manalnor Posted March 23, 2010 Share Posted March 23, 2010 Hello. if we have function called $timestamp = mktime($timestamp); it knows the time now okay then let $timestamp1 = mktime(0, 0, 0, 12, 20, 2010); means at month 12 day 20 year 2010 and $timestamp2 = mktime(0, 0, 0, 12, 21, 2010); and $timestamp3 = mktime(0, 0, 0, 12, 22, 2010); and if i can say if ( $timestamp > $timestamp1 ) { echo = "love you"; } as you can see if now time is more than tamp1 say love you how than i can say if now time is more than $timestamp1 say love you and if more than $timestamp2 say love you and if more than $timestamp3 say love you....ect hope you've got the point thanks in advance Link to comment https://forums.phpfreaks.com/topic/196238-if-and-array/ Share on other sites More sharing options...
aeroswat Posted March 23, 2010 Share Posted March 23, 2010 store them in an array like this $arr = array(); $arr[] = $timestamp1; $arr[] = $timestamp2; etc. Then use a loop to go through them. for($i = 0; $i < count($arr); $i++) { if($timestamp > $arr[$i]) { echo "I love you"; } } Link to comment https://forums.phpfreaks.com/topic/196238-if-and-array/#findComment-1030562 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.