Hi there!
I'm using:
if (isset($_SESSION['startTime'])){
$age = (time() - $_SESSION['startTime']);
echo '' . floor($age / 60) . ' minutes, ' . ($age % 60) . ' seconds';
} else {
$_SESSION['startTime'] = time();
echo "now";
}
to echo out the age of a session. This works perfectly, however I can't seem to make it to show "x hours, x minutes, x seconds" - and make it only show the one that has a value.
For example, if it was just 30 secs, it shouldn't show minutes or hours, just 30 seconds, and so on.
Can anyone help me with that?
Thanks!