PHP echo and print Statement

PHP echo and print Statement tutorial explain you Basic ways to get output in PHP simple examples.

Basic ways to get output in PHP

1) echo Statement

2) print Statement

The PHP echo Statement

echo is a language construct, and might be utilized with or without brackets likes echo or echo().

Syntax for echo Statement

Example on echo Statement

Output will be:

The PHP print Statement

print is language construct, and might be utilized with or without brackets likes print or print().

Syntax for print statement

Example on PHP print Statement

Output will be:

Difference between echo and print

echo – can output one or more strings

print – can only output one string, and returns always 1

echo is faster than print as echo does not return any value.

SHARE
Previous articlePHP Constants
Next articlePHP Global Variables
I am a young Information Systems Security Engineer(CEH). I had started with penetration testing when i am 17 years old. It all started with Kali linux and Metasploit.In free time i will play with Security holes/Bug bounty/Pentesting and Hacking !!!