PHP BASICS FOR BEGINNERS PART – 1

INTRODUCTION:

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.

Example 1:

Figure: 1

Operators in PHP:

Operators are used to performing operations over the variables and values. In PHP, mainly have seven types of operators –

  1. Arithmetic operators
  2. Assignment Operators
  3. Comparison Operators
  4. Increment and Decrement Operators
  5. Logical Operators
  6. String Operators
  7. Array Operators

Arithmetic Operators:

In arithmetic, Operators have addition, subtraction, multiplication, division and also modulus etc.

Example 2:-

Figure: 2

Assignment Operator:

The simple mean of the assignment operator is assigning any type of value to the variable.

Example 3:

Figure: 3

Comparison Operators:

In this operator, we can say that it is used to compare two values like string or numbers.

Example 4:

Figure: 4

Increment/Decrement Operators:

This operator is used for increment and decrement of the variable’s value.

Example 5:

Figure: 5

Logical Operators:

It is used to combine the conditional statements. Decrement example same as the Increment.

Example 6:

Figure: 6

String Operators:

Php has one operator which is specially designed for the strings.

Example 7:

Figure: 7

Array Operators:

Array operators are used to comparing arrays.

Example 8:

Figure: 8

Conclusion:

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.

1 thought on “PHP BASICS FOR BEGINNERS PART – 1”

  1. Pingback: PHP BASICS FOR BEGINNERS PART – 0 – Blog | Securium Solutions

Leave a Comment

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