Slide 1
Most trusted JOB oriented professional program
DevOps Certified Professional (DCP)

Take your first step into the world of DevOps with this course, which will help you to learn about the methodologies and tools used to develop, deploy, and operate high-quality software.

Slide 2
DevOps to DevSecOps – Learn the evolution
DevSecOps Certified Professional (DSOCP)

Learn to automate security into a fast-paced DevOps environment using various open-source tools and scripts.

Slide 2
Get certified in the new tech skill to rule the industry
Site Reliability Engineering (SRE) Certified Professional

A method of measuring and achieving reliability through engineering and operations work – developed by Google to manage services.

Slide 2
Master the art of DevOps
Master in DevOps Engineering (MDE)

Get enrolled for the most advanced and only course in the WORLD which can make you an expert and proficient Architect in DevOps, DevSecOps and Site Reliability Engineering (SRE) principles together.

Slide 2
Gain expertise and certified yourself
Azure DevOps Solutions Expert

Learn about the DevOps services available on Azure and how you can use them to make your workflow more efficient.

Slide 3
Learn and get certified
AWS Certified DevOps Professional

Learn about the DevOps services offered by AWS and how you can use them to make your workflow more efficient.

previous arrow
next arrow

Echo Statement, Print Statement, and Here document in PHP.

Echo Statement

This statement is used to output the data to the screen or printing text on the screen. For Example:-
echo “Sushant Kumar”;
echo ‘Sushant Kumar’;
echo 59.236;
echo (“Sushant Kumar”);
echo “Sushant” , “Kumar”;
echo “Sushant” . “Kumar”;

Note- We use both (,) and (.) for concate.

echo with HTML

You can use HTML tags with echo statement and tags should be written under double quote(“Example”). For Example:-

Output: Sushant Kumar

echo with Variable

You can also use echo with a variable to print the value of the variable. For Example:-
$value1 = 10
to print the value of variable value1 we write,
echo $value1;

then, it prints the value,

Output:- 10

We can also display both text and variable value at once, see below
Here Variable is

$name = “Sushant”;
echo “I am ” , $name;

Output: I am Sushant

If you want to use HTML tags in Variable then, see the below example

It Display’s name in Bold,

Output:- Sushant

Note:- 1. The text should be enclosed with quotes. 2. HTML tags should be enclosed with quotes.

Print Statement

This is very similar to the echo statement, a way of displaying text. For Example:-

Output: Sushant Kumar

Similarly, if you want to display text and variable both, then see the below example:-

Output: Hello, I am Sushant Kumar

Difference Between print and echo.

  1. echo has no return value while print is more like PHP function so it returns a value, which is always set to 1.
  2. echo can take multiple parameters while print can take only one.
  3. echo is marginally faster than print.

Here document in PHP

PHP here document is another way of displaying text. a here document(heredoc) is just some text inserted directly in a PHP page.

Syntax:-

For Example:-

Output:-
Hello
I am sushant kumar
I am A boy

Click Here For Next Part – What are Comments, Constant Variable, String Interpolation, Arithmetic and Assignment Operators in PHP?