Along the lines of the ridicolously simple strtotime() function, Is there a simple way to parse strings such as "1 hour 30 mins", "1.5 hours", "90 mins", "an hour and a half" into an integer value representing the corresponding number of seconds?
+4
A:
i think what you need to convert to seconds:
strtotime('+1 hour 30 mins') - time()
joetsuihk
2010-01-22 09:24:46
i'd just like to add that this methid does work, but strtotime probably isnt as flexible enough in what strings it will correctly interpret for this to be of real world use. For example '+1.5 hours' and '+1 hour AND 30 mins' both fail.
WibblePoop
2010-01-27 22:58:18