Php 404 Not Found Header

后端 未结 2 1072
自闭症患者
自闭症患者 2021-01-12 12:23

I am trying to understand the combination of 3 simple php code lines, This is the code:

ob_end_clean();
header(\'HTTP/1.0 404 Not Found\');
exit;
         


        
2条回答
  •  不知归路
    2021-01-12 12:39

    why should i use the exit After the 404 header

    So that no further code will be executed. If there isn't any then, fine, it isn't necessary in this case. It's a good habit to get into though.

    Also why with the BOM i dont get "headers already sent error"

    You didn't configure your PHP installation to show errors and notices to the end user.

提交回复
热议问题