alin19 Posted March 4, 2008 Share Posted March 4, 2008 i have 2 data like this: 2008-01-23 11:48:42 2008-01-23 11:48:52 how can i compare witch one is first? Quote Link to comment Share on other sites More sharing options...
shocker-z Posted March 4, 2008 Share Posted March 4, 2008 If it's in a database then SELECT * FROM tablename ORDER BY date DESC that will return with the closest date first. Regards Liam Quote Link to comment Share on other sites More sharing options...
alin19 Posted March 4, 2008 Author Share Posted March 4, 2008 but if it is in a file? Quote Link to comment Share on other sites More sharing options...
shocker-z Posted March 4, 2008 Share Posted March 4, 2008 I havent tested but you could try putting the dates into an array and using sort() see link below http://uk2.php.net/manual/en/function.sort.php#76198 Regards Liam Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.