简体   繁体   中英

How can I make a countdown timer in PHP?

How can I make a countdown timer in PHP which starts at 40 seconds and counts in this format:

40.59 - 40.48 - 40.47 - etc etc

I also need a button that resets it.

Is this possible in PHP? Do I need to use JavaScript?

You would do this entirely on the client side using Java* script *, there are many examples if you google for javascript countdown , ex http://keith-wood.name/countdown.html .

PHP is executed server side; You'll need to use JavaScript or some other client-side language (flash, silverlight, java applet, etc) if you want it displayed to a user in real-time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM