Jump to content

Echo or print?


eduard

Recommended Posts

The difference between echo and print() is that print() can be used anywhere that a function can while echo cannot. Another difference is that echo can have several parameters separated by commas.Function behavior from print()

$a = print('Something');echo $a; // outputs "1"

Echo can take several parameters

echo 'A', 'B', 'C', 'D';

For more information, read the manual pages for echo and print:http://php.net/echohttp://php.net/print

Link to comment
Share on other sites

The difference between echo and print() is that print() can be used anywhere that a function can while echo cannot. Another difference is that echo can have several parameters separated by commas.Function behavior from print()
$a = print('Something');echo $a; // outputs "1"

Echo can take several parameters

echo 'A', 'B', 'C', 'D';

For more information, read the manual pages for echo and print:http://php.net/echohttp://php.net/print

Ok, thanks very much!(P. s. not the php manual in german please? My emglish is better as my german!) So, it depends to the quantity of values if you use ´print´ or ´echo´? Edited by eduardlid
Link to comment
Share on other sites

I'm not the one choosing the language. The PHP manual chooses the language automatically when you get there. I always use echo because print has no advantages over it.

Link to comment
Share on other sites

I'm not the one choosing the language. The PHP manual chooses the language automatically when you get there. I always use echo because print has no advantages over it.
Ok, thanks!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...