PHP Knowledge Base

The Difference Between echo and return

echo - Output one or more strings

return - If called from within a function, the return statement immediately ends execution of the current function, and returns its argument as the value of the function call. return will also end the execution of an eval() statement or script file.

for examples of this see bettermousetraps.net