PHP Variable/Operator

In Computer languages variables are used for storing information.Variables are like a container.

In PHP Dollar ($) is used with variable declairation

<?php
$x = "PHP is a Language!";
$y = 10;
$z = 1.2;
?>

In PHP variable starts using the $ sign.
In PHP variable name must start with a letter or the underscore character
In PHP Variables are assigned with the = operator.
A variable name cannot start with a number
It contain only alpha-numeric characters and underscores (A-z, 0-9, and _ )
Variable in php are case-sensitive

Operator

What is operator

1+1
1 and 1 are called operands and + is called operator

following are PHP operator

Arithmetic operators
Assignment operators
Comparison operators
Increment/Decrement operators
Logical operators
String operators
Array operators

Leave a Reply

Your email address will not be published. Required fields are marked *