Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 240851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:42:05+00:00 2026-05-11T20:42:05+00:00

Possible Duplicate: How are echo and print different in PHP? UPDATE : I found

  • 0

Possible Duplicate:
How are echo and print different in PHP?

UPDATE :

I found to my relief an exact duplicate (it wasn’t showing up when I typed this question at first, I found it with … google):
Please vote with me to close this question, because it’s tiring, go hunt that other poor guy a bit 😉


Is there any difference between print and echo in PHP? If so, which should I use and when? If not, why are there two keywords?

UPDATE :

At the downvoters : please read the SO faq. SO was setup also to capture googleable questions. so you shouldn’t downvote for that, this question is a valid question, answered on a lot of places and now on SO too.

Of course you can downvote for another reason, but please leave a comment in the lines of
-1 : downvoted for .. , cause for now, I’m not understanding the downvotes.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:42:05+00:00Added an answer on May 11, 2026 at 8:42 pm

    From this link, suggested by the PHP manual entry for the echo() function:

    1. Speed. There is a difference between the two, but speed-wise it
      should be irrelevant which one you
      use. echo is marginally faster since
      it doesn’t set a return value if you
      really want to get down to the nitty
      gritty.

    2. Expression. print() behaves like a function in that you can do: $ret =
      print “Hello World”; And $ret will be

    3. That means that print can be used as part of a more complex expression
      where echo cannot. An example from
      the PHP Manual:

      $b ? print “true” : print “false”;

    print is also part of the precedence
    table which it needs to be if it is
    to be used within a complex
    expression. It is just about at the
    bottom of the precedence list though.
    Only “,” AND, OR and XOR are lower.

    1. Parameter(s). The grammar is: echo expression [, expression[, expression]
      … ] But echo ( expression,
      expression ) is not valid. This would
      be valid: echo (“howdy”),(“partner”);
      the same as: echo “howdy”,”partner”;
      (Putting the brackets in that simple
      example serves no purpose since there
      is no operator precedence issue with a
      single term like that.)

    So, echo without parentheses can take
    multiple parameters, which get
    concatenated:

    echo “and a “, 1, 2, 3; //
    comma-separated without parentheses
    echo (“and a 123”); // just one
    parameter with parentheses

    print() can only take one parameter:

    print (“and a 123”); print “and
    a 123”;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 117k
  • Answers 118k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer class Program { static void Main(string[] args) { Timer timer… May 11, 2026 at 10:50 pm
  • Editorial Team
    Editorial Team added an answer Use GROUP_CONCAT SELECT GROUP_CONCAT(bar) FROM TABLE GROUP BY foo; May 11, 2026 at 10:50 pm
  • Editorial Team
    Editorial Team added an answer Your code doesn't work because the function is not returning… May 11, 2026 at 10:50 pm

Related Questions

Possible Duplicate: How can I convert my java program to an .exe file ?
Possible Duplicate: How to run a terminal inside of vim? I can setup my
Possible Duplicate: How do I generate a hashcode from a byte array in c#
Possible Duplicate: How Random is System.Guid.NewGuid()? Based on this question I would like to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.