When using the location of the header, you must call exit();
Why? Since the execution of the script will not be completed.
Parentheses () are optional, exit is a language construct, not a function, and it's actually a bad idea (PHP has more work if they exist), just a terrible habit that I have.
user557846
source share