473,396 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

What is most efficient using multiple includes in one call?

Example... which would you chose...

Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. include_once ($_SERVER['DOCUMENT_ROOT']."/include/header.php");
  3. include_once ($_SERVER['DOCUMENT_ROOT']."/include/top-articles.php");
  4. include_once ($_SERVER['DOCUMENT_ROOT']."/include/breadcrumbs-articles.php");
  5. ?>
OR

Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. include_once ('../../include/header.php');
  3. include_once ('../../include/top-index.php');
  4. ?>
Oct 12 '10 #1
1 1269
Dormilich
8,658 Expert Mod 8TB
personally, I’d use neither of them. I’d just define a constant for the include directory (absolute path) and prefix the files with it.
Expand|Select|Wrap|Line Numbers
  1. // INCLUDE_DIR would resolve to e.g. /var/www/myproject/include
  2. include INCLUDE_DIR . "myfile.php";
Oct 12 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Linus Nikander | last post by:
Having recently load-tested the application we are developing I noticed that one of the most expensive (time-wise) calls was my fetch of a db-connection from the defined db-pool. At present I fetch...
6
by: JezB | last post by:
What is the most efficient way to scan an array for a match ? I could just iterate directly through it comparing each array entry with what I am looking for, I could use an enumerator to do the...
3
by: Brent Minder | last post by:
What is the most efficient way to code asp.net pages when you break your page up into user controls? For example: If you have a page with a header (control .ascx), body, and footer (control...
4
by: Anders | last post by:
Hi, I was wondering what is most efficient of the two. Is it more efficient to add server controls within the Itemtemplate and use OnItemDataBound to manipulate and databind the servercontrols. ...
2
by: booksnore | last post by:
..eh I was stuck thinking up a subject title for this post for a while.. So I am processing a really big file (scary big). Each record is fixed length, I need to test conditions on certain fields...
13
by: chrisben | last post by:
Hi, I need to insert more than 500,000 records at the end of the day in a C# application. I need to finish it as soon as possible. I created a stored procedure and called it from ADO to insert...
4
by: monomaniac21 | last post by:
hi all can anyone tell me what the performance implications are of using multiple includes on a page. do includes increase performance in anyway? do they make a signifcantly negative impact? or...
1
by: Maxwell2006 | last post by:
Hi, I am working with strongly typed datatables. What is the most efficient way to build a new DataTAble based on the result of DataTable.Select? At this point I use a foreach loop to do the...
4
by: jperezvazquez | last post by:
Hello All, I am implementing some functionality within my application where I need to use the HttpWebRequest to call a 3rd party service (messaging). The URLs that I use have the form of: ...
1
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
Using .NET 2.0 is it more efficient to copy files to a single folder versus spreading them across multiple folders. For instance if we have 100,000 files to be copied, Do we copy all of them to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.