efficiency question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Guy
Forum Commoner
Posts: 53
Joined: Sun Jan 12, 2003 3:34 am

efficiency question

Post by Guy »

hi
when writing a php page that generates html , some times a lot of html,
I was wondering what is more efficient:
to print the whole html at once or by parts.
for example: if I have a big table, should I append to it the trs and tds
and then print it , or print each tr alone.
there might be a question of timing out when appending and sending big string.
also , what is more efficient from experience, print or echo ?
thanks
Guy
laserlight
Forum Commoner
Posts: 28
Joined: Wed Jan 01, 2003 6:41 am

Post by laserlight »

I think for the first part, it really depends on your code.

As for echo and print, generally there isnt much difference, though echo could be marginally faster as it is purely a language construct, unlike print which can act as a function.
User avatar
Kriek
Forum Contributor
Posts: 238
Joined: Wed May 29, 2002 3:46 am
Location: Florida
Contact:

Post by Kriek »

A little off topic, but still on efficiency.
Read Inline Over Echo.
Post Reply