Home  >  Article  >  Backend Development  >  php资料include静态文件,效果跟直接访问静态文件一样吗

php资料include静态文件,效果跟直接访问静态文件一样吗

WBOY
WBOYOriginal
2016-06-13 11:04:58772browse

php文件include静态文件,效果跟直接访问静态文件一样吗

        {
include'/123.html');
}
?>



我在首页文件 index.php  写这个代码 载入123.html文件,这个跟直接访问123.html效果一样吗? 百度收录的效果
------解决方案--------------------
是一样的 。楼主可自己测试
------解决方案--------------------
url不一样
其他一样
------解决方案--------------------
执行起来效果是一样的,通常网站头、尾都是这样引进来的
------解决方案--------------------
include 相当于把 123.html 的代码拷到了 index.php 里面 
------解决方案--------------------
可以访问下网页 查看源码 你会发现include文件的源码就都在里面了  要是include的是PHP文件 会调用这个PHP文件
------解决方案--------------------
页面效果是一样。
但 百度收录的效果 就不一样了。后缀名都不同了。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn