Skip to content
Advertisement

Is there’s a way to shut down window with php?

I want to shut my window down using PHP, but I haven’t found any good resource. I wonder if there is a way to do that in PHP.

Advertisement

Answer

Yeah. But no.

echo '<script>window.close();</script>';

Please, just please don’t take this too seriously. PHP is a server side language. Which means it has no access to your browser itself. You should try using JavaScript if you have the chance.

Resources to close the window using JavaScript: https://developer.mozilla.org/en-US/docs/Web/API/Window/close

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement