简体   繁体   English

PHP Include()-页眉和页脚

[英]PHP Include() - Header and Footer

I use php include() for my header, footer, navigation etc. 我将php include()用于页眉,页脚,导航等。

I have the following code repeated on each of my pages 我在每个页面上都重复了以下代码

  <?php include 'includes/header.php'; ?>

Is there a faster way to do this? 有更快的方法吗? Can I store the data i am including somewhere for loading speed?? 我可以将要包括的数据存储在加载速度快的地方吗?

  1. If you aren't experiencing any problems with loading pages, you shouldn't be concerned of a faster ways. 如果您在加载页面时没有遇到任何问题,则不必担心更快的方法。

  2. If you're experiencing some problems with page loading, these problems certainly NOT from the way you're including headers. 如果您在页面加载方面遇到一些问题,那么这些问题肯定不是您包含标题的方式造成的。 You have to profile your site execution and find real part that slows whole thing down. 您必须分析网站的执行情况,并找到使整个过程变慢的真正部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM