include() speed question

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

p3x
New php-forum User
New php-forum User
Posts: 17
Joined: Mon Mar 03, 2003 10:53 am

include() speed question

Postby p3x » Wed Mar 12, 2003 3:45 am

Hello,

Maybe someone can shed some light on this issue... 'does include() speed up or slow down a script?'
I wondered this because as it is now all my pages look something like this:

Code: Select all

<?php include 'start.php'; ?>
HTML garbage here
<?php include 'header.php'; ?>
more HTML garbage here
<?php include 'center.php'; ?>
even more HTML garbage here
<?php include 'middle.php'; ?>
and yet more HTML garbage here
<?php include 'footer.php'; ?>


In short: a lot of includes. Is this faster or slower then putting the php code directly into the page? :?

P3x
[/code]

User avatar
Skeletor
New php-forum User
New php-forum User
Posts: 147
Joined: Tue Nov 19, 2002 7:47 am
Location: US, Ohio
Contact:

Postby Skeletor » Wed Mar 12, 2003 4:18 am

I imagine it will be just a tad slower since it has to open other files that include the code. I’ve never noticed much difference to justify not doing it. Plus the time you save on maintaining your site with only having to change/update a handful of included files instead of a few dozen scripts is well worth it.

User avatar
WiZARD
Moderator
Moderator
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Re: include() speed question

Postby WiZARD » Wed Mar 12, 2003 5:22 am

Actually it's slow but more effective


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 2 guests

cron