How to make a countdown using PHP

RSM picture RSM · Dec 22, 2010 · Viewed 77.7k times · Source

Im creating a website for my brothers wedding. And so far all is going well. However, he wants a countdown to the wedding on the homepage;

Time left until the wedding: X months, X days, X hours.

I would preferebly like to do this using php, but would be open to other suggestions.

if you can help me with ideas for the coding, or just point me to relevant material, that would be useful.

The wedding is on Saturday 30th July.

Answer

Vincent Mimoun-Prat picture Vincent Mimoun-Prat · Dec 22, 2010

If your need your counter to be displayed only on page refresh and be static once the page is loaded, then PHP will be fine.

If you need the countdown to get refreshed when the page is displayed, you'll need to use JavaScript.

Personally I would go for something already implemented, like that small script.