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 will need JavaScript to achieve a timer.
Some useful resources:
http://www.elated.com/articles/javascript-timers-with-settimeout-and-setinterval/
http://www.dynamicdrive.com/forums/showthread.php?t=61593
http://www.devshed.com/c/a/JavaScript/Using-Timers-in-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.