我正在为我的项目开发一个 SEO 系统,并且正在用一个页面优化所有链接。
文件摘录.htaccess:
RewriteRule ^(.+)$ seo.php [L,QSA]
此 SEO 文件 ( seo.php) 将获取请求的路径并将其解析为我的脚本中的有效 url。
我include('cat.php?catid=1')在最后使用seo.php,一切正常,但我想知道哪个更快:include()还是file_get_contents()?
当我使用file_get_content('cat.php?catid=1')时,它会显示 PHP 文件的源代码,但是当我使用 时file_get_content('http://localhost/cat.php?catid=1'),它会显示正常页面。
那么,哪个更快:file_get_content()或include()?