起首,翻开php编辑器,新建php文件,比方:index.php。(引荐进修:PHP编程从入门到通晓)
在index.php中,输入代码:echo ("<script>setTimeout('window.location.reload()', 1);</script>");。
浏览器运转index.php页面,此时发明页面会自动革新。
代码:
<?php //echo "体系当前时候戳为:"; echo ""; echo time(); echo "<br>"; //<!--JS 页面自动革新 --> echo ("<script type=\"text/javascript\">"); echo ("function fresh_page()"); echo ("{"); echo ("window.location.reload();"); echo ("}"); echo ("setTimeout('fresh_page()',1000);"); echo ("</script>"); ?>
以上就是php怎样自动革新页面的细致内容,更多请关注ki4网别的相干文章!