Will using <?PHP include " ";?> make our websites load fast?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Netroxy
Forum Commoner
Posts: 29
Joined: Sat Apr 09, 2011 5:38 pm

Will using <?PHP include " ";?> make our websites load fast?

Post by Netroxy »

Ive used a couple of includes in my web page. I thought of the idea to remove some of the PHP code from the main .php page because I am hearing that overloading a single page with lines of PHP can slow down that page itself. So I put some of the codes into separate .php files. For example, I removed the unique visitor counter code out of the main page and placed it into a separate file called counter.php and I called that page with <?PHP include "http://www.blabla.com/counter.php" ; ?>. Same goes for the counter script that shows how many users are online. Is it better to use includes with our webpages? Does it make our pages load faster? Are there any benefits for using it?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Will using <?PHP include " ";?> make our websites load f

Post by pickle »

There are no PHP-only benefits to using include files. The benefit is solely to help you to maintain the code. Breaking off different functionality into different files, simplifies each file for when you need to edit them.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply