Easy to analyze time duration in PHP

Along the lines of the ridiculously simple strtotime () function, is there an easy way to parse strings like "1 hour 30 minutes", "1.5 hours", "90 minutes", "hour and a half" into an integer value representing the corresponding number of seconds?

+3
source share
1 answer

I think you need to convert to seconds:

strtotime('+1 hour 30 mins') - time()
+7
source

Source: https://habr.com/ru/post/1729539/


All Articles