eduard Posted May 6, 2012 Share Posted May 6, 2012 What has the preference: echo or print? Link to comment Share on other sites More sharing options...
Ingolme Posted May 6, 2012 Share Posted May 6, 2012 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 More sharing options...
eduard Posted May 6, 2012 Author Share Posted May 6, 2012 (edited) 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 May 6, 2012 by eduardlid Link to comment Share on other sites More sharing options...
Ingolme Posted May 6, 2012 Share Posted May 6, 2012 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 More sharing options...
eduard Posted May 7, 2012 Author Share Posted May 7, 2012 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now