Is there a faster way to include PHP files?

时间:2015-06-26 10:08:25

标签: php require php-include

I have the following code when I want to include some code from another PHP file:

$domain = 'www.example.com';
require_once $domain.'/footer.php');

I wonder though if this is slower than it could be, because surely this then has to go through a DNS to find the page?

Is there a quicker way to do this? Maybe I should set my IP as $domain? Or maybe there is some PHP snippet that will detect it for me?

I also pay for DNS hits, so there's that too...

1 个答案:

答案 0 :(得分:1)

No thought You can include file via autoloader but there is no other way to include files than

Require and include in php and both are fast, even if you use temples it would be same.

相关问题