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? Link to comment https://forums.phpfreaks.com/topic/94240-data-comparing/ 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 Link to comment https://forums.phpfreaks.com/topic/94240-data-comparing/#findComment-482713 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? Link to comment https://forums.phpfreaks.com/topic/94240-data-comparing/#findComment-482721 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 Link to comment https://forums.phpfreaks.com/topic/94240-data-comparing/#findComment-482726 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.