Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

does <?php echo html ; ?> slow my site

Posted on 2007-12-06
5
Medium Priority
?
398 Views
Last Modified: 2008-02-01
Hi experts,

In a file called config.php  I have this variable:
$path_to_pics = 'can/forum/picture';

And in the rest of the site I replaced every picture:
<img src='can/forum/picture/rtl.gif' />
With :
<img src='<?php echo $path_to_pics ?>/rtl.gif' />

Is this going to affect the speed of my site or the use of the server?
If yes, what is the best way to deal with this?


Regards,
0
Comment
Question by:uk1900
  • 3
5 Comments
 
LVL 2

Accepted Solution

by:
TheHound earned 800 total points
ID: 20425704
It will hardly effect things. Maybe a few milliseconds here and there, but it shouldn't be noticeable unless your server is unusually slow.

-TheHound
0
 
LVL 21

Assisted Solution

by:nizsmo
nizsmo earned 600 total points
ID: 20425706
Should not, I use this myself, and with/without the path appending with the PHP, I do not notice any loading time differences (tried testing it once or twice, and no time differences).
0
 
LVL 2

Expert Comment

by:TheHound
ID: 20425711
By the way, it will do you more good than bad anyway because if you ever changed a directory, you just need to change one variable.
0
 
LVL 25

Assisted Solution

by:imitchie
imitchie earned 600 total points
ID: 20425713
Not by any noticeable amount.  Check out free php websites like drupal, phpbb or joomla - there are a hundred times more complex and has many more $references!
0
 
LVL 2

Expert Comment

by:TheHound
ID: 20425738
What imitchie said is quite true. Think of forums software such as IPB. They have thousands of lines of PHP code just like yours, and it takes under a second.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question