代碼以下:url
// echo "setTimeout("."window.location.href='{$url}';".",5000);";//setTimeout 無效
echo "setTimeout(\"window.location.href='".$url."'\",2000);";//setTimeout 有效 ,注意這裏setTimeout中code參數必定要加上雙引號("").net
參考連接:http://blog.csdn.net/athrunsun/article/details/6471814code