• GK & Current Affairs
  • Exam Calender
  • IQ Puzzles
  • Comics Sections
  • Login
  • Registration
  • Reffer & earn
Knowledgedunia

,

  • Home
  • Category
    • Aptitude
    • General Studies
    • Reasoning
    • Puzzles
    • Programming Language
    • Interview
    • Database
    • Networking
    • Solr
  • Interview
  • Online Test
  • General Knowledge
    • Important Days
  • Ask Now !
  • Solr
  • HR
  • Puzzles
  • Reasoning

Time:

Question Detial

  1. Home
  2. PHP
  3. Basics
  4. What are difference between ECHO and PRINT?

What are difference between ECHO and PRINT?

6 years ago 487 Views

There is slight difference between echo and print. But both are used to print line of code to the browser.
There are two main difference between echo and print:-

  • echo does not return any value while print returns true or false on successful print.
  • echo is faster than print.
  • print can be used in expressions, where echo cannot.


ECHO :

  • Language constuct and behaves like statement. It won't return value.
  • echo takes multiple parameter seperated by commas.
  • Faster than print.


PRINT:

  • Language construct and behaves like function. It return true / false.
  • print is part of precedence table.
  • print take only one parameter.


  • Echo works faster than print().
  • Echo and print are language construct.
  • Print behaves as a function and it returns an integer value.
  • Echo does not returns any values.
  • Echo is not suitable for conditional construct
  • Print is suitable for conditional construct.
  • Print process is slower than echo

PHP Basics

Thread Reply

Hot Questions


  • What are the advantages and disadvantages of Standard Query Parser?
  • What is Apache Solr?
  • How to Get the Size of all Tables in a database in MySQL?

  • Explain Faceting in Solr.
  • What is MVC?

Recent Comments


  • Aziz Panna on
  • Brijesh Maurya on

    What is Laravel framework?

Knowledge Dunia
 
  • Solr Interview Questions
  • Earth Day Questions
  • PHP Interview Questions
  • HR Interview Questions
  • Important Day Of The Year
  • MySQL Interview Questions
  • General Awareness Questions
  • Railway Questions
  • CakePHP Interview Questions
  • Ask Your Question Now!
  • Sports Questions
  • About us
  • Contact Us
  • Facebook
  • Twitter
  • Google Plus

© 2016 cubetodice.com. All rights reserved.

Sign Up with Facebook
Sign Up with Google

OR

MALE FEMALE

By clicking on the button "Register" you agree to be the terms of service (User Agreement)

Already Register Sing In

×
Sign In with Facebook Sign In with Google

Forgot password?