![]() |
|
Which do you prefer - Echo or Print, and why? - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: PHP (https://sinister.li/Forum-PHP) +--- Thread: Which do you prefer - Echo or Print, and why? (/Thread-Which-do-you-prefer-Echo-or-Print-and-why) Pages:
1
2
|
RE: Which do you prefer - Echo or Print, and why? - $ninja - 09-06-2015 echo is actually marginally faster, so why not. RE: Which do you prefer - Echo or Print, and why? - Miracle - 09-06-2015 #EchoMasterRace. RE: Which do you prefer - Echo or Print, and why? - d4ne - 09-07-2015 Simply using echo, because its mainstream
RE: Which do you prefer - Echo or Print, and why? - Chainsmoke - 09-10-2015 #EchoMasterRace Most teachings and "free information" use Echo, simple as that. The more it's taught, the more it's going to be used. RE: Which do you prefer - Echo or Print, and why? - Kevin_SF - 09-10-2015 Didn't even know print was a thing, so echo. RE: Which do you prefer - Echo or Print, and why? - Sophisticated - 09-10-2015 Echo was what I first learnt. Print is gay imo RE: Which do you prefer - Echo or Print, and why? - ClawsMissingBall - 09-18-2015 (02-08-2015, 09:38 AM)zoran Wrote: The two ways of getting text to the output are Echo and Print. They differ in significant ways. Perhaps you want to share why you prefer one over the other and the situations you might lean on way or the other? Echo and print are vastly different things, and you really shouldn't use them interchangeably at all. Echo prints out things that are already strings, and converts everything else (accept for complex data structures like multilayer arrays or objects). Echo is not a function; not kidding. Print renders complex data-structures in a format that is understandable by humans, and is there to convert what echo cannot. Print uses more memory, and you should only use it when you have to. Also print is a function. All in all, you would be a fool to value one over the other, as they are used for completely different things. RE: Which do you prefer - Echo or Print, and why? - Dastil - 11-30-2015 I usually use echo, or require_once() a file. Never really used print before in PHP. Not sure why. RE: Which do you prefer - Echo or Print, and why? - ReggyFreddy - 11-30-2015 It depends on the situation, but I usually default to echo, however there is way to achieve an "echo overflow" in PHP. So it really depends. |