what is difference between header and include, where which one should be used

前端 未结 8 1874
我在风中等你
我在风中等你 2021-02-07 18:58

I am confused with two terms

  1. header (\"Location:homepage_php\");

  2. include(\"homepage.php\");

I am g

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-07 19:37

    Header forwards the user to a new page, so PHP reinitializes, it's like a HTML meta redirection, but faster.

    Include just includes the file where you call it, and it executes it as PHP, just like if the code from homepage.php was written where you write .

提交回复
热议问题