How to convert hours, minutes, and seconds into several seconds in PHP | PHP programs
Jan 20, 2022
PHP,
4240 Views
How to convert hours, minutes, and seconds into several seconds in PHP | PHP programs
How to convert hours, minutes, and seconds into several seconds in PHP | PHP programs
We will convert hours, minutes, and seconds into the number of seconds.
<?php
$hh = 1;
$mm = 48;
$ss = 50;
$seconds = $hh * 3600 + $mm * 60 + $ss;
print ("Number of seconds: " . $seconds);
?>