Sometimes, we need to announce something on the website or want to wish any festival to our readers then we need a kind of timer (we can say, it is countdown timer) to be displayed on the website.
In this post, we are writing PHP code that will display a countdown timer for "Diwali" on the webpage.
In this code,
- We are using a function strtotime() which is used to artificially generate the timestamp for a selected date and time.
- We are defining date and time for festival “Diwali”, which is known as target date time, the value is "2017-10-19 12:00:00.
- And, as a current date time we are using now which gives current date and time.
PHP code (with HTML) to display countdown timer
Output

need an explanation for this answer? contact us directly to get an explanation for this answer