Closed Thread Icon

Topic awaiting preservation: PHP - (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=12344" title="Pages that link to Topic awaiting preservation: PHP - (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: PHP - <span class="small">(Page 1 of 1)</span>\

 
Lurch
Paranoid (IV) Inmate

From: Behind the Wheel
Insane since: Jan 2002

posted posted 08-03-2002 20:29

i don't think it'll make too much of a difference on a small file, but.... which would be better, many little blocks of php to run or one big one (sorry i'm having a hard time wording what i mean )..

example..

code:
<html>
...( more html )
...
<img src="<? echo($site_url); ?>/images/top.jpg">
<img src="<? echo($site_url); ?>/images/oreo.jpg">
..
..



Versus

code:
<?
$top="
<html>
...( more html )
...
<img src=\"$site_url/images/top.jpg\">
<img src=\"$site_url/images/oreo.jpg\">
..
.. ";

echo($top);

?>


know what i mean??

the first would seem to require less compiling on the server, but would it be better to compile it all in one chunk like the second? the second seems a lot easier for me to look through and troubleshoot because there aren't a bunch of little php blocks scattered throughout it. For a small project should i just not worry about this and pick the method i feel more comfortable with, or should i worry about it???

thanks

[edit]CRAP! i forgot to go back and add something to my topic title... like "php - code blocks" or something.. sorry for the shitty title [/edit]
--Lurch--

[This message has been edited by Lurch (edited 08-03-2002).]

[This message has been edited by Lurch (edited 08-03-2002).]

Lurch
Paranoid (IV) Inmate

From: Behind the Wheel
Insane since: Jan 2002

posted posted 08-03-2002 20:46

hmmm.. seems like i'll have to go with the second one for other reasons... still like to know if one would take longer or more server resources

--Lurch--

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 08-05-2002 19:33

There shouldn't be any considerable performance issues it's my understanding (and I got this from MrMax so he may be able to clarify more) that PHP actually parses the whole page and essentially just echo's anything that is not inside the php delimeters.



.:[ Never resist a perfect moment ]:.

« BackwardsOnwards »

Show Forum Drop Down Menu