How would I construct a statement like if current time ($time) is more than 30 seconds past time ($djs['currenttime'])? Would it be something like
if ($time => $djs['currenttime'])? I can’t figure it out with the 30 seconds..:).
Thanks :).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The 30 seconds you are struggling with it’s simply a
+30added on the conditional incrementing the value of$djs['currenttime'].You can use the
time()function to get the actual time. I’m assuming thatdjs['currenttime']is a value extracted from the database. Therefore the comparison would be the following:time()returns the number of seconds since Jan 1st 1970 00:00:00 GMT so for this to work, the format of the$djs['currenttime']variable should also be a unix timestamp. If not, you will need to convert one of them to the appropriate format first.