PHP is a server-side scripting language which is used in the backend of any process of a website. In earlier days PHP introduces a personal home page but Now It is known as hypertext preprocessor. Now 80% of websites are running over the PHP technology which works in backend. User cannot see the backend process of any website and web application. If we take an example like a mobile phone which is used for the calling but doesn’t know the backend process of calling etc. We will start to learn PHP from the basics like variables, operators, functions and many more.
Variables in PHP:
“Variables are simply the name of the memory location and also we can say that variable looks like a container which is used for the information storing of both numeric and non-numeric information.”
- PHP variables start with the dollars sign, which is defined as the variable name.
- Variables name should start with the underscore character (_) and the letters also.
- Variables name can contain only alphanumeric (A-Z, a-z, 0-9) characters and Underscores (_).
- Variables name does not contain any space.
Operators in PHP:
Operators are used to performing operations over the variables and values. In PHP, mainly have seven types of operators –
- Arithmetic operators
- Assignment Operators
- Comparison Operators
- Increment and Decrement Operators
- Logical Operators
- String Operators
- Array Operators
In arithmetic, Operators have addition, subtraction, multiplication, division and also modulus etc.
The simple mean of the assignment operator is assigning any type of value to the variable.
In this operator, we can say that it is used to compare two values like string or numbers.
This operator is used for increment and decrement of the variable’s value.
It is used to combine the conditional statements. Decrement example same as the Increment.
Php has one operator which is specially designed for the strings.
Array operators are used to comparing arrays.
I have just completed the basics of PHP in this Blog and some topics are covered like Introduction of PHP, Variables, Operators in this first part. In another part we will discuss further and we will go step by step from beginners level to advance in PHP.