What are the differences between echo and print in PHP?

Member

by sidney , in category: Technology , 3 years ago

What are the differences between echo and print in PHP?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by melvina , 3 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.