What are different types of Print Functions available in PHP?

by trycia.jones , in category: Technology , 3 years ago

What are different types of Print Functions available in PHP?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by kenny , 3 years ago

Difference between echo and print in PHP


echo in PHP

  • echo is language constructs that display strings.
  • echo has a void return type.
  • echo can take multiple parameters separated by comma.
  • echo is slightly faster than print.

Print in PHP

  • print is language constructs that display strings.
  • print has a return value of 1 so it can be used in expressions.
  • print cannot take multiple parameters.
  • print is slower than echo.
by heather_fritsch , 3 years ago

PHP is a server side scripting language for creating dynamic web pages. There are so many functions available for displaying output in PHP. Here, I will explain some basic functions for displaying output in PHP. The basic functions for displaying output in PHP are as follows:

  • print() Function
  • echo() Function
  • printf() Function
  • sprintf() Function
  • Var_dump() Function
  • print_r() Function