|
Posted by james on 06/02/05 01:17
On Wed, 1 Jun 2005 15:11:34 -0700, "Tony" <someone@somewhere.not>
wrote:
>I'm just wondering why it seems most people use "echo" instead of "print". I
>tend to use "print", probably because I started programming in BASIC back in
>78, so it's just familiar.
>
>Echo can take multiple expressions (as in "echo
>$string1,$string2,$string3"), which apparently is a bit faster than multiple
>concatenations. But for basic output, there doesn't seem to be a noticeable
>difference. The speed test at http://dynacker.dotgeek.org/printvsecho/ shows
>a "5%" difference in speed, but this amounts to a negligible difference in
>actual execution time on a typical script.
>
>So - why does one choose "echo" over "print", or vice-versa?
>
Hi Tony,
Heres a link about echo vs print:
http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40
I personally use echo because of all the other people that use it, the
documents i've read and the code i've studied. However, i really
don't use echo that much anymore, rather just escape php like so:
if ($blah == "blah") {
?>blah = "<?=$blah?>"<?
}
but thats messy, maybe i'm just lazy
Navigation:
[Reply to this message]
|