我是 php 新手并试图弄清楚,如何在保持其他网页打开的同时关闭打开的网页。例如,我想打开 yahoo.com 网页,如下面的代码所示。然后我想关闭这个 yahoo.com 页面并打开 google.com 页面。
<?php
//To open yahoo.com page
echo '<script type="text/javascript" language="javascript">
window.open("http://www.yahoo.com/");
</script>';
//How can I close the yahoo.com page and let the program keep running
echo "<script>window.close();</script>";
sleep(10);
//To open google.com page
echo '<script type="text/javascript" language="javascript">
window.open("http://www.google.com/");
</script>';
echo "Done";
?>