web_master Posted August 31, 2007 Share Posted August 31, 2007 Can tell me someone is some big different between "echo" and "print". What You prefer to use? Thanx, w_m Quote Link to comment https://forums.phpfreaks.com/topic/67438-echo-or-print/ Share on other sites More sharing options...
LemonInflux Posted August 31, 2007 Share Posted August 31, 2007 you know, I've often wondered this. I don't do much complex stuff, but normally I use echo outside big codes, and print in. E.G., if I wanted a '____ is complete!', I'd use print, but if I just wanted an if _ = _, I'd use echo. But meh, not sure. Quote Link to comment https://forums.phpfreaks.com/topic/67438-echo-or-print/#findComment-338511 Share on other sites More sharing options...
pl_harish Posted August 31, 2007 Share Posted August 31, 2007 For a short discussion about the differences between print() and echo(), see this FAQTs Knowledge Base Article: http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40 I prefer to use echo and its different forms.. like <?= "print this" ?> short tag outputs echo <<<END print whatever is here.. just like it is. This is for some reason refered to as "here document" syntax. adfa df a d a <<<END and the usual ones. echo "hello"; echo ("hello"); I use print.. only as print_r() for printing arrays during debugging. This function print_r() is very helpful for printing arrays in a structured manner. For example: $testArray = array("hello", "world"); print_r($testArray); //outputs array() { [0] = hello [1] = world } Quote Link to comment https://forums.phpfreaks.com/topic/67438-echo-or-print/#findComment-338512 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.