Announcement

Collapse
No announcement yet.

echo or print

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • echo or print

    which is best to use? why? whats the differences?

    thanks

  • #2
    echo - language construct
    print - function

    PHP Manual
    PHP Code:
    // Because echo is not a function, following code is invalid.
     
    ($some_var) ? echo('true'): echo('false'); 

    Comment


    • #3
      Is one faster than the other, though?
      "63,000 bugs in the code, 63,000 bugs, you get 1 whacked with a service pack, now there's 63,005 bugs in the code."
      "Before you critisize someone, walk a mile in their shoes. That way, when you critisize them, you're a mile away and you have their shoes."
      Utopia Software - Current Software: Utopia News Pro (news management system)

      Comment


      • #4
        That one brings up some arguments, I believe. I don't think either is faster then the other, and if one is faster then the other, the difference will be so small it won't make a difference. (hehe, say that 5 times fast )

        Comment


        • #5
          http://www.faqts.com/knowledge_base/...l/aid/1/fid/40
          Echo is marginally faster, according to this article, because it doesn't return a value, whereas print does. Print is a function, echo is a language construct. The basic difference is, as Cagez mentioned above, is that echo cannot be used as part of an complex expression.
          Last edited by TiLaser; Tue 16 Sep '03, 3:47pm.

          Comment


          • #6
            http://forums.invisionpower.com/inde...dpost&p=670268

            Comment


            • #7
              thanks everyone!

              Comment

              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
              Working...
              X