Print and Echo

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
Zeceer
Forum Contributor
Posts: 136
Joined: Fri Aug 02, 2002 5:10 am
Location: Norway

Print and Echo

Post by Zeceer »

I've heard that print is a function and echo is a commando, but is there any reasons for why using echo in some situations, while useing print in other? What is really the difference between them?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

print() returns a value whereas echo() does not. Other than that there's no difference. Which you use is down to personal preference, I use echo() cause it's got one less character to type.

Mac
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

..and can take more than one argument ;)
Post Reply