Outputting data in PHP: print vs echo vs printf vs var_dump vs print_r

Kuol
2 min readJul 9, 2020

PHP provides us with many ways to output data onto a screen. Most of the time PHP developers use these built-in functions interchangeably. Each function has a specific use-case and by the end of this article you will know how to properly use them.

Difference between print, echo and printf vs var_dump and print_r

--

--