Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试让一个计数器在 PHP 中工作,所以它基本上计算 '5' 然后 '4' 等等直到 0。它将重定向到不同的页面。我只是想知道如何在 PHP 中做到这一点?如果可能的话,如果不是,它会在 javascript 中是什么?
看看这个。除此之外......你真的应该尝试自己做一些原创研究,如果你无法通过说明你的问题并向我们展示你当前的解决方案/方法来提出有意义的问题。
以下代码将在 5 秒后重定向:
<script> setTimeout(function () { window.location.href = "newpage.html"; }, 5000); //seconds </script>
这是倒数计时器的示例:链接