What are the differences between echo and print in PHP?

Member

by sidney , in category: Technology , 4 years ago

What are the differences between echo and print in PHP?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by melvina , 4 years ago

The differences are as follows:

  • echo does not return a value whereas print does return a value of 1 (this enables print to be used in expressions).
  • echo can accept multiple parameters (although such usage is rare) while print can only take a single argument.


Related Threads:

What are different types of Print Functions available in PHP?
What Are the Key Differences Between Postgresql and Mysql?
What are the differences between the UX and UI?
What is difference Between PHP 5 and 7?
How to Create a Composer Package in 2025?
How to Write a for Loop in Bash in 2025?