---
title: "PHP Introduction"  
description: "PHP is an HTML-embedded scripting language.First version of PHP was developed by Rasmus Lerdorf in 1994."  
author: "Royce Roy"  
published: 2016-06-04  
updated: 2020-03-28  
canonical: https://www.mindstick.com/articles/12150/php-introduction  
category: "c#"  
tags: ["php"]  
reading_time: 6 minutes  

---

# PHP Introduction

##

##### What is PHP?

PHP is an HTML-embedded [scripting language](https://www.mindstick.com/blog/486/scripting-language).First version of PHP was developed by Rasmus Lerdorf in 1994.

§ PHP is a recursive acronym for “PHP:Hypertext Preprocessor”. PHP is a [programming](https://yourviews.mindstick.com/view/88478/vibe-coding-the-rise-of-ai-assisted-programming) langauage allows [web developers](https://www.mindstick.com/blog/11763/five-features-of-top-python-frameworks-for-web-developers-in-2018-that-make-everyone-love-it) to create [dynamic web](https://yourviews.mindstick.com/view/85261/understanding-java-servlets-a-guide-to-building-dynamic-web-applications) pages.

§ PHP is a widely used [open source](https://www.mindstick.com/articles/337437/how-to-leverage-open-source-for-innovative-project-development) scripting language that is especially suited for [web development](https://www.mindstick.com/services/web-development).It is used to manage [dynamic content](https://www.mindstick.com/forum/158483/how-does-server-side-caching-interact-with-dynamic-content-or-user-specific-data-on-a-website),session tracking,databases,even built entire e-commerce sites.

§ PHP is a scripting language ,like HTML.That means its code does not need to be compiled.

§ PHP is free .Download it from www.php.net

§ PHP syntax is C-like.

##### Uses of PHP

- Using PHP you can create,delete,insert,modify within your database.
- PHP can send and receive cookies.
- PHP can can generate dynamic page.
- Using php, you can restrict users to access some pages of your websites.
- It can encrypt data

##### PHP Operator

PHP supports following types of operator:

· Arithmetic Operators

· Assignment Operators

· Comparision Operators

· Increment/Decrement Operators

· Logical Operators

· String Operators

· Array Operators

##### Arithmetic Operator:

Let the value of $x = 10 & $y = 20.Now let’s perform some arithmetic operation:

| ## Operator | ## Name | ## Example | ## Result |
| --- | --- | --- | --- |
| ‘+’ | Addition | $x + $y | 30 |
| ‘-’ | Subtraction | $x - $y | -10 |
| ‘*’ | Multiplication | $x * $y | 200 |
| ‘/’ | Division | $x / $y | 2 |
| ‘%’ | Modulus | $x % $y | 0 |

##### PHP Assignment Operators:

There are some assignment operators supported by PHP:

Let the value of $x = 10 .Now let’s perform some Assignment operation:

| ## Assignment | ## Also written as | ## Description | ## Result |
| --- | --- | --- | --- |
| x=y | x=y | The left operand get the value of right operand. | 10 |
| x+=y | x=x+y | Addition:$x=10 $x+=100; echo $x | 120 |
| x-=y | x=x-y | Subtraction:$x=10 $x-=100; echo $x | -90 |
| x*=y | x=x*y | Multiplication:$x=10 $x*=100; echo $x | 1000 |
| x/=y | x=x/y | Division:$x=10 $x/=5; echo $x | 2 |
| x%=y | x=x%y | Modulus:$x=15 $x%=4; echo $x | 3 |

##### PHP Comparision Operators:

PHP Comparision operators are used to [compare two](https://www.mindstick.com/forum/23112/how-to-compare-two-arraylists-of-type-arraylist-string) values.these value can be number or string.

| ## Operator | ## Name | ## Example | ## Result |
| --- | --- | --- | --- |
| == | Equal | $a==$b | Returns true if $a is equal to $b. |
| === | Identical | $a===$b | Returns true,if $a is equal to $b along with same data type. |
| != | Not equal | $a!=$b | Returns true if $a is not equal to $b |
| <> | Not equal | $a<>$b | Returns true if $a is not equal to $b |
| !== | Not identical | $a!==$b | Returns true,if $a is not equal to $b and not of same data type. |
| > | Greater than | $a>$b | Returns true if $a is greater than to $b |
| < | Less than | $a<$b | Returns true if $a is less than to $b |
| >= | Greater than or equal | $a>=$b | Returns true if $a is greater or equal to $b |
| <= | Less than or equal | $a<=$b | Returns true if $a is less or equal to $b |

##### PHP Increment/Decrement Operators:

Let the value of $a=10

| ## Operator | ## Name | ## Description | ## Result |
| --- | --- | --- | --- |
| ++$a | Pre-increment | Increment $a by 1, than return the value | 11 |
| $a++ | Post-increment | [Return value](https://www.mindstick.com/forum/33675/how-to-convert-return-value-of-abmulivaluecopylabelatindex-into-nsstring-in-ios),than increment by 1 | 10 |
| --$a | Pre-decrement | Decrement by 1,than return the value | 9 |
| $a-- | Post-decrement | Return value,than decrement | 10 |

##### PHP Logical Operator

These operators are used to combine conditional statements.

| ## Operator | ## Name | ## Example | ## Result |
| --- | --- | --- | --- |
| and | And | $a and $y | True if both $a and $b are true |
| or | Or | $a or $b | True if either $a or $b is true |
| xor | Xor | $a xor $b | True if either $a or $b is true but not both |
| && | And | $a && $b | True if both $a and $b are true |
| \|\| | Or | $a \|\| $b | True if either $a or $b is true |
| ! | Not | $a! | True if $a is not true |

##### PHP string Operators

These operators are used specially in strings.

| ## Operator | ## Name | ## Example | ## Result |
| --- | --- | --- | --- |
| . | [Concatenation](https://www.mindstick.com/forum/34153/how-to-write-program-to-file-concatenation-program-in-java-i-o) | $a.$b | Concatination of $a and $b |
| .= | Concatination assignment | $a.=$b | Append $b to $a |

##### PHP Array Operators

These array operators are used to compare.

| ## Operator | ## Name | ## Result | ## Example |
| --- | --- | --- | --- |
| + | Union | $a + $b | Union of $a and $b |
| == | Equality | $a == $b | Returns true if $a and $b have same key/value |
| === | Identity | $a===$b | Returns true if $a and $b have same key/value In same order and same type |
| != | Inequality | $a != $b | Returns true if $a is not equal to $b |
| <> | Inequality | $a <> $b | Returns true if $a is not equal to $b |
| !== | Non-identity | $a !== $b | Returns true if $a is not identical to $b |

---

Original Source: https://www.mindstick.com/articles/12150/php-introduction

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
