when to use "echo" and when to use "print"

Discussion in 'PHP' started by whiteblue1942, Mar 14, 2008.

  1. #1
    ok i know this sounds dumb but im new to php and dont understand when to use each one. they seem the same to me . any advice pleasE?:D
     
    whiteblue1942, Mar 14, 2008 IP
  2. uppaluri

    uppaluri Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Both do the same thing. Difference is, echo does not have a return value.
    With print, you can capture the return value. (hav'nt seen any code doing it though !)
    I use print , just because of my C, java background.

    Here is a link from php manual on this topic
    http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40
     
    uppaluri, Mar 14, 2008 IP
  3. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #3
    I summed it up on another forum:
    http://www.programmingtalk.com/showpost.php?p=141047&postcount=6
     
    nico_swd, Mar 15, 2008 IP
    whiteblue1942 likes this.
  4. whiteblue1942

    whiteblue1942 Peon

    Messages:
    573
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #4
    aka use echo haha
     
    whiteblue1942, Mar 15, 2008 IP