Tutorial English Time to Seconds
Just type in the time you want converted to seconds in english (e.g. "1 hour and 30 minutes") and it will be converted to an integ...
https://iskablogs.blogspot.com/2014/03/tutorial-english-time-to-seconds.html
Just type in the time you want converted to seconds in english (e.g. "1 hour and 30 minutes") and it will be converted to an integer of seconds (e.g. 5400). Thanks to Baylor Rae.
function time2seconds($time) {
preg_match_all('/(\d+ [a-z]+)/', $time, $matches);
$matches = $matches[0];
$formats = array();
foreach ($matches as $format) {
preg_match('/(\d+)\s?([a-z]+)/', $format,
function time2seconds($time) {
preg_match_all('/(\d+ [a-z]+)/', $time, $matches);
$matches = $matches[0];
$formats = array();
foreach ($matches as $format) {
preg_match('/(\d+)\s?([a-z]+)/', $format,