PHP/AJAX/Javascript Display website "age"
178
I would like to display my website age but as a live result (like a reverse countdown via AJAX or so). Right now I have a PHP script that looks like:
<?php
echo secondsToTime(time()-(1203234532)); # number = timestamp when website was created
function secondsToTime($seconds) {
$dtF = new DateTime("@0");
$dtT = new DateTime("@$seconds");
return $dtF->diff($dtT)->format('%a days, %h hours, %i minutes and %s seconds');
}
php>
Now the actual age is displayed everytime the website is reloaded but how can I make it live?
Greetings