Why I have to call 'exit' after redirection through header('Location..') in PHP?

后端 未结 6 1657
刺人心
刺人心 2020-11-22 10:38

You know that if you want to redirect an user in PHP you can use the header function:

header(\'Location: http://smowhere.com\');

It is also

6条回答
  •  佛祖请我去吃肉
    2020-11-22 11:30

    PHP Code after a header() will be run. Sometimes, that is required though, as the example on php.net shows. To make sure it's not, you end the program flow entirely.

提交回复
热议问题