Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

What is difference between echo, print, and print_r in PHP with example?

Echo Statement:-
The echo statement is used to output in display with or without parenthesis echo or echo() but no return value. Echo Statement faster than print Statement.
ex:-

Print Statement:-
Print Statement is used as Echo Statement but the print statement has a return value of 1. Print Statement not as fast as the Echo Statement.
ex:-

Print_r function in PHP:-
Print_r function is used to display or print information, which is readable by humans.
ex:-

Rajesh Kumar
Follow me