SlideShare a Scribd company logo
Features of PHP PHP stands for Hypertext Preprocessor“.  It is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.  It is an interpreted language. There are three main fields where PHP scripts are used.  Server side scripting Command line scripting.  Writing client-side GUI applications.For this PHP-GTK is used.  PHP-GTK is an extension for the PHP programming language that implements language bindings for GTK+. It provides an object-oriented interface to GTK+ classes and functions and greatly simplifies writing client-side cross-platform GUI applications.
PHP can be used on all major operating systems, including Linux, many Unix variants, Microsoft Windows, Mac OS X  etc.  PHP has also support for most of the web servers today. This includes Apache, Microsoft Internet Information Server, Personal Web Server, Netscape and iPlanet servers, Oreilly Website Pro server  and many others.
You also have the choice of using procedural programming or object oriented programming, or a mixture of them.  PHP does more than just generating dynamic web-pages.  PHP's abilities includes: Generating images dynamically PDF files  Flash movies Compression Download and upload XML support
PHP also has support for talking to other services using protocols such as LDAP, IMAP, SNMP, NNTP, POP3, HTTP, COM (on Windows) and countless others.  You can also open raw network sockets and interact using any other protocol.  PHP has support for the WDDX complex data exchange between virtually all Web programming languages. (Support for web services) PHP has support for instantiation of Java objects and using them transparently as PHP objects. You can also use CORBA extension to access remote objects.  e.g. You can use java classes in php.
A sample PHP script <html> <head> <title>PHP Test</title> </head> <body> <?php  echo &quot;<p>Hello World</p>&quot;;  echo phpinfo(); ?> </body> </html>  A call to the  phpinfo()  function returns a lot of useful information about your system and setup such as available predefined variables, loaded PHP modules, and configuration settings.
php syntaxes are similar to C. php is whitespace insensitive. e.g. $four =  2 + 2; php is sometimes case insensitive.  i.e. All variables are case sensitive.
Basics of variable Variables in PHP are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive. PHP is also context-sensitive like perl.  A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.
PHP provides 8 primitive data-types. Four scalar types: boolean integer float string Two compound types array object Two special types: resource NULL PHP,types are associated with values rather than variables. No previous declaration is needed. You can assign value to variable as and when you need it. e.g.  $int_var=15; $str=“string1”;
If you want to check out the type and value of a certain variable, use  var_dump() .  It dumps information about variable. <?php $b = 3.1; $c = true; var_dump($b, $c); ?>  o/p :  float(3.1)  bool(true)  If you want to get type of a variable, then use gettype(). echo gettype($bool); // prints out &quot;boolean“ echo gettype($str);  // prints out &quot;string“
To check type of veriables in condition, separate functions are there for each type.  basic syntax is is_type(variable) some of it are is_integer  is_float  is_numeric  is_string is_scalar is_object is_array  It returns true if variable will be of that specific type. Otherwise it returns false. If you would like to force a variable to be converted to a certain type, you may either cast the variable or use the  settype()  function on it.  It returns true on success and false on failure. settype($var, &quot;integer&quot;);
In php, default error reporting setting allows you to use unassigned variables without errors. To change this setting you should set error reporting level to E_ALL in your php.ini file. error_reporting(E_ALL); To check if variable is assigned a value or not, use isset($var) . PHP variables are global in scope. You can use it throughout your program.
To define boolean variable, $flag=True; To define string variable, $str=“string variable”; String can be enclosed in double quotes, single quotes or you can also use heredoc operator. $str = <<<EOF Example of string spanning multiple lines using heredoc syntax. EOF; To define constant, define(&quot;MAXSIZE&quot;, 100);
Operators Arithmetic : +,-,/,%,* String . , .=  Assignment operators for all above operators. +=, -= etc , ++ , -- Comparision == , != , <> , > , >= , < , <= , === === returns true if its two operands are having the same value, and they are of the same type.  e.g.  $a=15; $b=15; if( $a === $b) { print “Identical variables”; }
PHP supports one execution operator: backquotes (``).  PHP will attempt to execute the contents of the backquotes as a system command; the output will be returned in a variable. <?php $output = `ls`; echo &quot;<pre>$output</pre>&quot;; ?>
Control Structures if,else,elseif while,for , do..while , for , foreach , break , continue , switch  $i=1; switch ($i) {     case 0:         print &quot;i equals 0&quot;;         break;     case 1:         print &quot;i equals 1&quot;;         break;     case 2:         print &quot;i equals 2&quot;;         break;     default :         print &quot;i equals -1&quot;; } comments .  # , // , /*  */
Ad

Recommended

Lesson 2 php data types
Lesson 2 php data types
MLG College of Learning, Inc
 
Lesson 4 constant
Lesson 4 constant
MLG College of Learning, Inc
 
Data types in php
Data types in php
ilakkiya
 
Lesson 6 php if...else...elseif statements
Lesson 6 php if...else...elseif statements
MLG College of Learning, Inc
 
PHP
PHP
Mohammed Hussein
 
PHP Basics
PHP Basics
Bhaktaraz Bhatta
 
Php intro by sami kz
Php intro by sami kz
sami2244
 
Php tutorial
Php tutorial
Mohammed Ilyas
 
Lesson 3 php numbers
Lesson 3 php numbers
MLG College of Learning, Inc
 
PHP Powerpoint -- Teach PHP with this
PHP Powerpoint -- Teach PHP with this
Ian Macali
 
C language updated
C language updated
Arafat Bin Reza
 
php basics
php basics
Anmol Paul
 
PHP Web Programming
PHP Web Programming
Muthuselvam RS
 
Ruby quick ref
Ruby quick ref
Tharcius Silva
 
Ruby cheat sheet
Ruby cheat sheet
Tharcius Silva
 
Free PHP Book Online | PHP Development in India
Free PHP Book Online | PHP Development in India
Deepak Rajput
 
PHP Basics
PHP Basics
Henry Osborne
 
Download It
Download It
webhostingguy
 
C Programming Project
C Programming Project
Vijayananda Mohire
 
Basic of PHP
Basic of PHP
Nisa Soomro
 
Introduction to Go language
Introduction to Go language
Tzar Umang
 
PHP Reviewer
PHP Reviewer
Cecilia Pamfilo
 
Introduction to php basics
Introduction to php basics
baabtra.com - No. 1 supplier of quality freshers
 
Introduction to php php++
Introduction to php php++
Tanay Kishore Mishra
 
Lesson 1 php syntax
Lesson 1 php syntax
MLG College of Learning, Inc
 
Python: an introduction for PHP webdevelopers
Python: an introduction for PHP webdevelopers
Glenn De Backer
 
Php Tutorial
Php Tutorial
Dr. Ramkumar Lakshminarayanan
 
course slides -- powerpoint
course slides -- powerpoint
webhostingguy
 
Butler zero
Butler zero
William Kritsonis
 
Unbreakable: Father
Unbreakable: Father
Jonathan Swales
 

More Related Content

What's hot (20)

Lesson 3 php numbers
Lesson 3 php numbers
MLG College of Learning, Inc
 
PHP Powerpoint -- Teach PHP with this
PHP Powerpoint -- Teach PHP with this
Ian Macali
 
C language updated
C language updated
Arafat Bin Reza
 
php basics
php basics
Anmol Paul
 
PHP Web Programming
PHP Web Programming
Muthuselvam RS
 
Ruby quick ref
Ruby quick ref
Tharcius Silva
 
Ruby cheat sheet
Ruby cheat sheet
Tharcius Silva
 
Free PHP Book Online | PHP Development in India
Free PHP Book Online | PHP Development in India
Deepak Rajput
 
PHP Basics
PHP Basics
Henry Osborne
 
Download It
Download It
webhostingguy
 
C Programming Project
C Programming Project
Vijayananda Mohire
 
Basic of PHP
Basic of PHP
Nisa Soomro
 
Introduction to Go language
Introduction to Go language
Tzar Umang
 
PHP Reviewer
PHP Reviewer
Cecilia Pamfilo
 
Introduction to php basics
Introduction to php basics
baabtra.com - No. 1 supplier of quality freshers
 
Introduction to php php++
Introduction to php php++
Tanay Kishore Mishra
 
Lesson 1 php syntax
Lesson 1 php syntax
MLG College of Learning, Inc
 
Python: an introduction for PHP webdevelopers
Python: an introduction for PHP webdevelopers
Glenn De Backer
 
Php Tutorial
Php Tutorial
Dr. Ramkumar Lakshminarayanan
 
course slides -- powerpoint
course slides -- powerpoint
webhostingguy
 

Viewers also liked (20)

Butler zero
Butler zero
William Kritsonis
 
Unbreakable: Father
Unbreakable: Father
Jonathan Swales
 
Trees I Know
Trees I Know
mbenson75
 
Copies de seguretat de dades amb cobianbackup
Copies de seguretat de dades amb cobianbackup
Pedro Pablo
 
Teresa Ann Hughes, Dissertation Defense, Dr. William Kritsonis, Dissertation ...
Teresa Ann Hughes, Dissertation Defense, Dr. William Kritsonis, Dissertation ...
William Kritsonis
 
Dr. S. Marie McCarther, University of Missouri - Kansas City
Dr. S. Marie McCarther, University of Missouri - Kansas City
William Kritsonis
 
Heaven and Hell
Heaven and Hell
Jonathan Swales
 
Canvi tauler de control
Canvi tauler de control
Pedro Pablo
 
Photographing Torture at Abu Ghraib: Gendered Violence and The Other
Photographing Torture at Abu Ghraib: Gendered Violence and The Other
Peter Pawlick
 
Chapter15[1]
Chapter15[1]
William Kritsonis
 
National FORUM of Multicultural Issues Journal, Dr. William Allan Kritsonis, ...
National FORUM of Multicultural Issues Journal, Dr. William Allan Kritsonis, ...
William Kritsonis
 
West Africa food crisis
West Africa food crisis
CAFOD
 
Ch 15 Legalities Affecting Schooling - Dr. William Allan Kritsonis
Ch 15 Legalities Affecting Schooling - Dr. William Allan Kritsonis
William Kritsonis
 
Bijoli's vegetable garden
Bijoli's vegetable garden
CAFOD
 
Samsung: Universe Campaign Concepts (Strategy)
Samsung: Universe Campaign Concepts (Strategy)
Jessica Legg
 
Dr. Fred C. Lunenburg, Escalation of Commitment - Published in the INTERNAT...
Dr. Fred C. Lunenburg, Escalation of Commitment - Published in the INTERNAT...
William Kritsonis
 
Russia pres. butler & kritsonis
Russia pres. butler & kritsonis
William Kritsonis
 
Preso orangevalley klantcongres
Preso orangevalley klantcongres
Sjef Kerkhofs
 
Student Rights & Bill Or Rights
Student Rights & Bill Or Rights
William Kritsonis
 
Fit Vortrag Micheuz
Fit Vortrag Micheuz
Peter Micheuz
 
Trees I Know
Trees I Know
mbenson75
 
Copies de seguretat de dades amb cobianbackup
Copies de seguretat de dades amb cobianbackup
Pedro Pablo
 
Teresa Ann Hughes, Dissertation Defense, Dr. William Kritsonis, Dissertation ...
Teresa Ann Hughes, Dissertation Defense, Dr. William Kritsonis, Dissertation ...
William Kritsonis
 
Dr. S. Marie McCarther, University of Missouri - Kansas City
Dr. S. Marie McCarther, University of Missouri - Kansas City
William Kritsonis
 
Canvi tauler de control
Canvi tauler de control
Pedro Pablo
 
Photographing Torture at Abu Ghraib: Gendered Violence and The Other
Photographing Torture at Abu Ghraib: Gendered Violence and The Other
Peter Pawlick
 
National FORUM of Multicultural Issues Journal, Dr. William Allan Kritsonis, ...
National FORUM of Multicultural Issues Journal, Dr. William Allan Kritsonis, ...
William Kritsonis
 
West Africa food crisis
West Africa food crisis
CAFOD
 
Ch 15 Legalities Affecting Schooling - Dr. William Allan Kritsonis
Ch 15 Legalities Affecting Schooling - Dr. William Allan Kritsonis
William Kritsonis
 
Bijoli's vegetable garden
Bijoli's vegetable garden
CAFOD
 
Samsung: Universe Campaign Concepts (Strategy)
Samsung: Universe Campaign Concepts (Strategy)
Jessica Legg
 
Dr. Fred C. Lunenburg, Escalation of Commitment - Published in the INTERNAT...
Dr. Fred C. Lunenburg, Escalation of Commitment - Published in the INTERNAT...
William Kritsonis
 
Russia pres. butler & kritsonis
Russia pres. butler & kritsonis
William Kritsonis
 
Preso orangevalley klantcongres
Preso orangevalley klantcongres
Sjef Kerkhofs
 
Student Rights & Bill Or Rights
Student Rights & Bill Or Rights
William Kritsonis
 
Ad

Similar to Php1 (20)

Introduction to PHP
Introduction to PHP
Jussi Pohjolainen
 
P H P Part I, By Kian
P H P Part I, By Kian
phelios
 
UNIT 1 (7).pptx
UNIT 1 (7).pptx
DrDhivyaaCRAssistant
 
UNIT 1 (7).pptx
UNIT 1 (7).pptx
DrDhivyaaCRAssistant
 
Basics of PHP by Dr.C.R.Dhivyaa Kongu Engineering College
Basics of PHP by Dr.C.R.Dhivyaa Kongu Engineering College
Dhivyaa C.R
 
Phpwebdevelping
Phpwebdevelping
mohamed ashraf
 
Php Crash Course
Php Crash Course
mussawir20
 
WT_PHP_PART1.pdf
WT_PHP_PART1.pdf
HambardeAtharva
 
Php Learning show
Php Learning show
Gnugroup India
 
What Is Php
What Is Php
AVC
 
Introduction to php
Introduction to php
KIRAN KUMAR SILIVERI
 
Php Basic
Php Basic
Md. Sirajus Salayhin
 
Internet Technology and its Applications
Internet Technology and its Applications
amichoksi
 
Basic PHP
Basic PHP
Todd Barber
 
php basics
php basics
NIRMAL FELIX
 
PHP Course (Basic to Advance)
PHP Course (Basic to Advance)
Coder Tech
 
Introduction in php
Introduction in php
Bozhidar Boshnakov
 
introduction to php and its uses in daily
introduction to php and its uses in daily
vishal choudhary
 
Php1
Php1
rajikaa
 
Introduction to php
Introduction to php
mohamed ashraf
 
Ad

More from Keennary Pungyera (6)

Sap procurement process flow
Sap procurement process flow
Keennary Pungyera
 
Link Tds
Link Tds
Keennary Pungyera
 
Interest Calculation
Interest Calculation
Keennary Pungyera
 
Php2
Php2
Keennary Pungyera
 
The Simple Life Very Beautiful 19082008
The Simple Life Very Beautiful 19082008
Keennary Pungyera
 
Fuction call
Fuction call
Keennary Pungyera
 

Recently uploaded (20)

How to Implement Least Package Removal Strategy in Odoo 18 Inventory
How to Implement Least Package Removal Strategy in Odoo 18 Inventory
Celine George
 
Health Care Planning and Organization of Health Care at Various Levels – Unit...
Health Care Planning and Organization of Health Care at Various Levels – Unit...
RAKESH SAJJAN
 
Code Profiling in Odoo 18 - Odoo 18 Slides
Code Profiling in Odoo 18 - Odoo 18 Slides
Celine George
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
Q1_ENGLISH_PPT_WEEK 1 power point grade 3 Quarter 1 week 1
Q1_ENGLISH_PPT_WEEK 1 power point grade 3 Quarter 1 week 1
jutaydeonne
 
Community Health Nursing Approaches, Concepts, Roles & Responsibilities – Uni...
Community Health Nursing Approaches, Concepts, Roles & Responsibilities – Uni...
RAKESH SAJJAN
 
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Pragya - UEM Kolkata Quiz Club
 
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
 
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
National Information Standards Organization (NISO)
 
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 
How to Manage Different Customer Addresses in Odoo 18 Accounting
How to Manage Different Customer Addresses in Odoo 18 Accounting
Celine George
 
LDMMIA Yoga S10 Free Workshop Grad Level
LDMMIA Yoga S10 Free Workshop Grad Level
LDM & Mia eStudios
 
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
Arshad Shaikh
 
“THE BEST CLASS IN SCHOOL”. _
“THE BEST CLASS IN SCHOOL”. _
Colégio Santa Teresinha
 
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Rajdeep Bavaliya
 
University of Ghana Cracks Down on Misconduct: Over 100 Students Sanctioned
University of Ghana Cracks Down on Misconduct: Over 100 Students Sanctioned
Kweku Zurek
 
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
Ultimatewinner0342
 
This is why students from these 44 institutions have not received National Se...
This is why students from these 44 institutions have not received National Se...
Kweku Zurek
 
Plate Tectonic Boundaries and Continental Drift Theory
Plate Tectonic Boundaries and Continental Drift Theory
Marie
 
How to Implement Least Package Removal Strategy in Odoo 18 Inventory
How to Implement Least Package Removal Strategy in Odoo 18 Inventory
Celine George
 
Health Care Planning and Organization of Health Care at Various Levels – Unit...
Health Care Planning and Organization of Health Care at Various Levels – Unit...
RAKESH SAJJAN
 
Code Profiling in Odoo 18 - Odoo 18 Slides
Code Profiling in Odoo 18 - Odoo 18 Slides
Celine George
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
Q1_ENGLISH_PPT_WEEK 1 power point grade 3 Quarter 1 week 1
Q1_ENGLISH_PPT_WEEK 1 power point grade 3 Quarter 1 week 1
jutaydeonne
 
Community Health Nursing Approaches, Concepts, Roles & Responsibilities – Uni...
Community Health Nursing Approaches, Concepts, Roles & Responsibilities – Uni...
RAKESH SAJJAN
 
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Pragya - UEM Kolkata Quiz Club
 
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
 
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 
How to Manage Different Customer Addresses in Odoo 18 Accounting
How to Manage Different Customer Addresses in Odoo 18 Accounting
Celine George
 
LDMMIA Yoga S10 Free Workshop Grad Level
LDMMIA Yoga S10 Free Workshop Grad Level
LDM & Mia eStudios
 
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
Arshad Shaikh
 
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Rajdeep Bavaliya
 
University of Ghana Cracks Down on Misconduct: Over 100 Students Sanctioned
University of Ghana Cracks Down on Misconduct: Over 100 Students Sanctioned
Kweku Zurek
 
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
Ultimatewinner0342
 
This is why students from these 44 institutions have not received National Se...
This is why students from these 44 institutions have not received National Se...
Kweku Zurek
 
Plate Tectonic Boundaries and Continental Drift Theory
Plate Tectonic Boundaries and Continental Drift Theory
Marie
 

Php1

  • 1. Features of PHP PHP stands for Hypertext Preprocessor“. It is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. It is an interpreted language. There are three main fields where PHP scripts are used. Server side scripting Command line scripting. Writing client-side GUI applications.For this PHP-GTK is used. PHP-GTK is an extension for the PHP programming language that implements language bindings for GTK+. It provides an object-oriented interface to GTK+ classes and functions and greatly simplifies writing client-side cross-platform GUI applications.
  • 2. PHP can be used on all major operating systems, including Linux, many Unix variants, Microsoft Windows, Mac OS X etc. PHP has also support for most of the web servers today. This includes Apache, Microsoft Internet Information Server, Personal Web Server, Netscape and iPlanet servers, Oreilly Website Pro server and many others.
  • 3. You also have the choice of using procedural programming or object oriented programming, or a mixture of them. PHP does more than just generating dynamic web-pages. PHP's abilities includes: Generating images dynamically PDF files Flash movies Compression Download and upload XML support
  • 4. PHP also has support for talking to other services using protocols such as LDAP, IMAP, SNMP, NNTP, POP3, HTTP, COM (on Windows) and countless others. You can also open raw network sockets and interact using any other protocol. PHP has support for the WDDX complex data exchange between virtually all Web programming languages. (Support for web services) PHP has support for instantiation of Java objects and using them transparently as PHP objects. You can also use CORBA extension to access remote objects. e.g. You can use java classes in php.
  • 5. A sample PHP script <html> <head> <title>PHP Test</title> </head> <body> <?php echo &quot;<p>Hello World</p>&quot;; echo phpinfo(); ?> </body> </html> A call to the phpinfo() function returns a lot of useful information about your system and setup such as available predefined variables, loaded PHP modules, and configuration settings.
  • 6. php syntaxes are similar to C. php is whitespace insensitive. e.g. $four = 2 + 2; php is sometimes case insensitive. i.e. All variables are case sensitive.
  • 7. Basics of variable Variables in PHP are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive. PHP is also context-sensitive like perl. A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.
  • 8. PHP provides 8 primitive data-types. Four scalar types: boolean integer float string Two compound types array object Two special types: resource NULL PHP,types are associated with values rather than variables. No previous declaration is needed. You can assign value to variable as and when you need it. e.g. $int_var=15; $str=“string1”;
  • 9. If you want to check out the type and value of a certain variable, use var_dump() . It dumps information about variable. <?php $b = 3.1; $c = true; var_dump($b, $c); ?> o/p : float(3.1) bool(true) If you want to get type of a variable, then use gettype(). echo gettype($bool); // prints out &quot;boolean“ echo gettype($str);  // prints out &quot;string“
  • 10. To check type of veriables in condition, separate functions are there for each type. basic syntax is is_type(variable) some of it are is_integer is_float is_numeric is_string is_scalar is_object is_array It returns true if variable will be of that specific type. Otherwise it returns false. If you would like to force a variable to be converted to a certain type, you may either cast the variable or use the settype() function on it. It returns true on success and false on failure. settype($var, &quot;integer&quot;);
  • 11. In php, default error reporting setting allows you to use unassigned variables without errors. To change this setting you should set error reporting level to E_ALL in your php.ini file. error_reporting(E_ALL); To check if variable is assigned a value or not, use isset($var) . PHP variables are global in scope. You can use it throughout your program.
  • 12. To define boolean variable, $flag=True; To define string variable, $str=“string variable”; String can be enclosed in double quotes, single quotes or you can also use heredoc operator. $str = <<<EOF Example of string spanning multiple lines using heredoc syntax. EOF; To define constant, define(&quot;MAXSIZE&quot;, 100);
  • 13. Operators Arithmetic : +,-,/,%,* String . , .= Assignment operators for all above operators. +=, -= etc , ++ , -- Comparision == , != , <> , > , >= , < , <= , === === returns true if its two operands are having the same value, and they are of the same type. e.g. $a=15; $b=15; if( $a === $b) { print “Identical variables”; }
  • 14. PHP supports one execution operator: backquotes (``). PHP will attempt to execute the contents of the backquotes as a system command; the output will be returned in a variable. <?php $output = `ls`; echo &quot;<pre>$output</pre>&quot;; ?>
  • 15. Control Structures if,else,elseif while,for , do..while , for , foreach , break , continue , switch $i=1; switch ($i) {     case 0:         print &quot;i equals 0&quot;;         break;     case 1:         print &quot;i equals 1&quot;;         break;     case 2:         print &quot;i equals 2&quot;;         break;    default :         print &quot;i equals -1&quot;; } comments . # , // , /* */