Introduction

This is my second article on PHP 7.0. In this article we discuss variables, comments, and single and double quotes of PHP. Here's my previous article link:

What Are Variables

Naming Variables

Good Naming Variables

Practice of Variables

In this step you can see that we declare one variable and assign it string. In the same way in C language we use printf for display and use echo for display. Now when you run program you can see the output which you declared in variable.

Practice of Variable

Comments

Practice of Comments

In this step you see that we write three comments and after writing comments we run the program and here's the output as well.

Practice of Comments

Difference between single quotes and double quotes

When you give a variable name“ (double quotes), it gives the value of the variable which you assign at top. But in single it gives another type of output.

output

You can see that when I place the variable name in single quotes it is treated like a string.

run

Escape Sequence

Aren’t Double Quotes Better?

Read more articles on PHP: