PHP 8 · Web, security and database

Redirect

Send a redirect and stop the script.

header('Location: /login', true, 302);
exit;

Official PHP 8 documentation

More web, security and database commands

All web, security and database commands · PHP 8 cheatsheet

Was this page helpful?