4 February 2011 0 Comments

[PHP] Optimize code-echo vs print functions


echo and print both are language constructs and both have the same functionality for output purpose. But if you look at the performance than echo is faster than print. Reason is simple as you may be aware that print will output the string on screen as well as it will return the status while echo will just output the string and finish the task. So print will take some more time than echo. prefer to use echo to write optimize PHP Code.