• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 403
  • Last Modified:

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

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
uk1900
Asked:
uk1900
  • 3
3 Solutions
 
TheHoundCommented:
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
 
nizsmoDeveloperCommented:
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
 
TheHoundCommented:
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
 
imitchieCommented:
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
 
TheHoundCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now