PHP Include() - 页眉和页脚 [英] PHP Include() - Header and Footer

查看:113
本文介绍了PHP Include() - 页眉和页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在每个页面上都重复了以下代码

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

有没有更快的方法来做到这一点?我可以存储数据,包括加载速度的地方吗?

解决方案


  1. 如果您在加载页面时没有遇到任何问题,您不应该担心更快的方式。

  2. 如果您遇到页面加载问题,这些问题肯定不是来自你包括头文件的方式。您有个人资料您的网站执行情况,并找到真实的部分,可以减缓整个过程。


I use php include() for my header, footer, navigation etc.

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.

这篇关于PHP Include() - 页眉和页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆