For day 4 of 21 in the “PHP Function of the day” series, I’m going to look at gettimeofday(). The function gets the current time of the day.
Let’s take a look.
<?php
print_r(gettimeofday());
?>
Since gettimeofday() outputs an array, we are using print_r() instead of echo() but don’t focus on that, yet. The array includes seconds since the Unix Epoch, microseconds, minutes west of Greenwich, and type of dst correction.