您可以sleep在服务器端使用,然后重定向到另一个页面header.或者,您可以发送带有<meta>标记的HTML页面,该标记指定重定向位置和延迟时间.
使用睡眠和标题
<?php
sleep(2);
header('Location: http://www.example.com/');
?>
Run Code Online (Sandbox Code Playgroud)
使用<meta>标签
<meta http-equiv="refresh" content="2;url=http://www.example.com/">
Run Code Online (Sandbox Code Playgroud)