What are the differences between echo and print in PHP?

Member

sidney

by sidney , in category: Technology , 2 months ago

What are the differences between echo and print in PHP?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

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