Home TechnologyProgramming Subscribe to RSS
 

What Is The Difference Between Echo And Print Commands?

Answer Question

1 Answer - Sort by: Date | Rating

    print and echo are commands used to show the message on the computer screen. These both commands perform same function i.e. Display the output. E.g

    Code:

    <. ?. Php
    print "Hi how are you!";
    echo " Hi how are you!";
    ?>

    Output :
    Hi how are you!
    Hi how are you!

    The above example displays the same result on the screen. But there is small difference between these two commands and it all depends upon their and outcome usage. The print command can return a true/false value while echo command can not. Print command can be helpful in some type of script execution. Echo command is considered much faster executed command than the print command.


    0 0

    Ellie82 

    answered 1 year ago

      Answer Question - Answers are editable for 5 min.

      If you do not Sign-in or Register your answers will be anonymous,

      your answers may also be checked before going online.

      More

         
         

        Ask a Question via Twitter

        Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

        Blurtit Store

        Get T-shirts, hoodies, caps and more at the Blurtit store

        Blurtit International