christopherpm Posted October 12, 2006 Share Posted October 12, 2006 I have, for example, 3 strings:-$sunrise = "7:30 am"$sunset = "6:25 pm"$time = "7:00 pm"I want my script to act differently based on whether $time falls inbetween $sunrise and $sunset, or outside (i.e. between $sunset and $sunrise)Can anyone give me a clue as to how the heck I do this? Thanks Link to comment Share on other sites More sharing options...
aspnetguy Posted October 12, 2006 Share Posted October 12, 2006 use strtotime() and then you can just use the < and > operators to check where time() falls between. Link to comment Share on other sites More sharing options...
christopherpm Posted October 13, 2006 Author Share Posted October 13, 2006 use strtotime() and then you can just use the < and > operators to check where time() falls between.Thank you, thank you, thank you.... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now