Freelance PHP Developer | Freelance PHP Programmer | PHP Freelance | Freelance Developer | PHP Freelancer | PHP Freelance Developers | PHP Developers | Freelance Developers | PHP Developer

[PHP] Optimize code-echo vs print functions

php

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.

echo( ‘PHP Freelance Developers’ ); // prefer to use – faster
print( ‘PHP Freelance Developers’ ); // do not use this – slower

      
Tweet
You can leave a response, or trackback from your own site.
    PHP Freelance | Freelance Developer | PHP Developer | PHP Freelancer | Freelance Developers | PHP Developers
    Freelance PHP Developer