Escolar Documentos
Profissional Documentos
Cultura Documentos
History of php
What is php ?
Features of php
php Contents
Advantage of php
Candidate`s Declaration
Rohit Hansaliya
Roll No. 18EREEC009
History of php :
<?php
….
?>
Example of Php code
<?php
$link = mysql_connect('localhost', 'root',
'Jodhpur@123');
$db = mysql_select_db('wd');
// Check connection
if($link == false){
die("ERROR: Could not connect. " .
mysqli_connect_error());
}
?>
Php Contents :
• Variables
• Constant
• Operators
• Array
• Functions
Variables :
Variables are used for storing values, such as
numbers, strings or function results, so that they can
be used many times in a script.
PHP variables must begin with a “$” sign
PHP variables are case –sensitive ($sign!=$sign
!=$sign)
Certain variable names reserved by PHP like form
variables
($_POST,$_GET), server variables
($_server),etc.
Operators :
•Arithmetic Operators (+,-,*,/)
•Example:- $total=$a+$b;
•Assignment Operators(=)
•Example :- $t=$a+$b;
?>
Functions :
<?php
function mul($arg1,$arg2)
{
$arg2=$arg1*$arg2;
return $arg2;
}
$result = mul(12,3); //Store the
function
echo $result1; //Output 36
?>
Advantage of PHP :
Open source
Procedural/Object Oriented Programming
Supports wide rang of Databases
Easy to learn
Portable
THANK YOU