SlideShare ist ein Scribd-Unternehmen logo
1 von 13
PHP: Hypertext Preprocessor The Building Blocks
Special Data Types Resource - Reference to a third-party resource (a database, for example) NULL - An uninitialized variable Sample <?php 	$testing; // declare without assigning 	print gettype( $testing ); // NULL	 	?>
PHP’s Type Functions var_dump()- tells you a variable's type and its contents Sample <php $testing = 5;  var_dump( $testing );  ?>
PHP’s Type Functions gettype()function - to acquire the type of any variable. If you place a variable between the parentheses of the function call, gettype() returns a string representing the relevant type (NULL, integer, string, double , boolean)  Sample <?php $testing = 5;  print gettype( $testing ); // integer  ?>
PHP’s Type Functions settype()function - to change the type of a variable. To use settype(), you must place the variable to change (and the type to change it to) between the parentheses and separate them by commas 	Sample 	<?php 	$undecided = 3.14; settype( $undecided, double ); 	print gettype( $undecided );  	print " -- $undecided<br />"; // 3.14 	?>
Operators and Expressions Operators- are symbols that enable you to use one or more values to produce a new value. A value that is operated on by an operator is referred to as an operand. 4+3   Expression- is any combination of functions, values, and operators that resolves to a value. 4+3=9 	$user=you; gettype( $user);   Assignment Operator - takes the value of its right operand and assigns it to its left operand $name = "matt";
Operators and Expressions Arithmetic Operators - The addition operator adds the right operand to the left operand, whereas the subtraction operator subtracts the right operand from the left. The division operator divides the left operand by the right, and the multiplication operator multiplies the left operand by the right. The modulus operator returns the remainder of the left operand divided by the right. Example (+)Addition 	(-)Subtraction 	(/)Division  (*) Multiplication 	(%)Modulus
Concatenation Operator The concatenation operator is a single period (.). Treating both operands as strings, it appends the right operand to the left Sample "hello"." world" is equivalent to "hello world"  $centimeters = 212;  print "the width is ".($centimeters/100)." meters";
Combined Assignment Operator consists of a standard operator symbol followed by an equals sign. Example $x = 4;$x = $x + 4; // $x now equals 8  	can instead be written as 	$x = 4;$x += 4; // $x now equals 8
Comparison Operators perform tests on their operands. They return the boolean value true if the test is successful and return false otherwise. This type of expression is useful in control structures, such as if and while statements Example $x=5.1 $x < 5
Logical Operators To test combinations of booleans Sample true || false = true 	true && false = false
Operator Precedence When you use an operator, the PHP engine usually reads your expression from left to right. Sample 4 + 5=9 	4 + 5 * 2 = 18    or     4 + 5 * 2 = 14   or   (4 + 5) * 2 = 18
Constants Variables offer a flexible way of storing data because you can change their values and the type of data they store at any time. If, however, you want to work with a value that you do not want to alter throughout your script's execution, you can define a constant. You must use PHP's built-in function define() to create a constant. After you have done this, the constant cannot be changed. To use the define() function, you must place the name of the constant and the value you want to give it within the call's parentheses. These values must be separated by a comma, like so: Example define ("CONSTANT_NAME", 42);  <?php  	define ("USER", "Gerald");  	print "Welcome".USER; 	?>

Weitere ähnliche Inhalte

Was ist angesagt?

Operators in c language
Operators in c languageOperators in c language
Operators in c language
Amit Singh
 
Dti2143 chapter 5
Dti2143 chapter 5Dti2143 chapter 5
Dti2143 chapter 5
alish sha
 

Was ist angesagt? (20)

C operator and expression
C operator and expressionC operator and expression
C operator and expression
 
Logical and Conditional Operator In C language
Logical and Conditional Operator In C languageLogical and Conditional Operator In C language
Logical and Conditional Operator In C language
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
Functions in c
Functions in cFunctions in c
Functions in c
 
C – operators and expressions
C – operators and expressionsC – operators and expressions
C – operators and expressions
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Method parameters in c#
Method parameters in c#Method parameters in c#
Method parameters in c#
 
Pointer to function 1
Pointer to function 1Pointer to function 1
Pointer to function 1
 
1. Pointer Basic
1. Pointer Basic1. Pointer Basic
1. Pointer Basic
 
Types of c operators ppt
Types of c operators pptTypes of c operators ppt
Types of c operators ppt
 
Python : basic operators
Python : basic operatorsPython : basic operators
Python : basic operators
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Functions in C
Functions in CFunctions in C
Functions in C
 
Operator of C language
Operator of C languageOperator of C language
Operator of C language
 
Operators in c language
Operators in c languageOperators in c language
Operators in c language
 
Python : Operators
Python : OperatorsPython : Operators
Python : Operators
 
parameter passing in c#
parameter passing in c#parameter passing in c#
parameter passing in c#
 
Types of function call
Types of function callTypes of function call
Types of function call
 
Dti2143 chapter 5
Dti2143 chapter 5Dti2143 chapter 5
Dti2143 chapter 5
 

Andere mochten auch

Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
honglee71
 
Types of databases
Types of databasesTypes of databases
Types of databases
PAQUIAAIZEL
 

Andere mochten auch (11)

Cio summit 20170223_v20
Cio summit 20170223_v20Cio summit 20170223_v20
Cio summit 20170223_v20
 
The hippocratic oath
The hippocratic oathThe hippocratic oath
The hippocratic oath
 
Types of database
Types of databaseTypes of database
Types of database
 
Intro to Graphs and Neo4j
Intro to Graphs and Neo4jIntro to Graphs and Neo4j
Intro to Graphs and Neo4j
 
Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph Databases
 
Graph database super star
Graph database super starGraph database super star
Graph database super star
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
 
HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)
 
Types of databases
Types of databasesTypes of databases
Types of databases
 
Graph database
Graph database Graph database
Graph database
 
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
 

Ähnlich wie Php-Continuation

Php Reusing Code And Writing Functions
Php Reusing Code And Writing FunctionsPhp Reusing Code And Writing Functions
Php Reusing Code And Writing Functions
mussawir20
 
Java Script Language Tutorial
Java Script Language TutorialJava Script Language Tutorial
Java Script Language Tutorial
vikram singh
 
P H P Part I, By Kian
P H P  Part  I,  By  KianP H P  Part  I,  By  Kian
P H P Part I, By Kian
phelios
 
C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)
jahanullah
 
C++ Function
C++ FunctionC++ Function
C++ Function
Hajar
 

Ähnlich wie Php-Continuation (20)

PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
Php Learning show
Php Learning showPhp Learning show
Php Learning show
 
Php Reusing Code And Writing Functions
Php Reusing Code And Writing FunctionsPhp Reusing Code And Writing Functions
Php Reusing Code And Writing Functions
 
Java Script Language Tutorial
Java Script Language TutorialJava Script Language Tutorial
Java Script Language Tutorial
 
P H P Part I, By Kian
P H P  Part  I,  By  KianP H P  Part  I,  By  Kian
P H P Part I, By Kian
 
Expressions and Operators.pptx
Expressions and Operators.pptxExpressions and Operators.pptx
Expressions and Operators.pptx
 
Learn PHP Basics
Learn PHP Basics Learn PHP Basics
Learn PHP Basics
 
OpenGurukul : Language : PHP
OpenGurukul : Language : PHPOpenGurukul : Language : PHP
OpenGurukul : Language : PHP
 
C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)
 
C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)
 
Basics of c++
Basics of c++ Basics of c++
Basics of c++
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
PHP - DataType,Variable,Constant,Operators,Array,Include and require
PHP - DataType,Variable,Constant,Operators,Array,Include and requirePHP - DataType,Variable,Constant,Operators,Array,Include and require
PHP - DataType,Variable,Constant,Operators,Array,Include and require
 
Project in TLE
Project in TLEProject in TLE
Project in TLE
 
Operators in PHP
Operators in PHPOperators in PHP
Operators in PHP
 
02 Php Vars Op Control Etc
02 Php Vars Op Control Etc02 Php Vars Op Control Etc
02 Php Vars Op Control Etc
 
C++ Function
C++ FunctionC++ Function
C++ Function
 
Vb.Net 01 To 03 Summary Upload
Vb.Net 01 To 03 Summary UploadVb.Net 01 To 03 Summary Upload
Vb.Net 01 To 03 Summary Upload
 
1_Python Basics.pdf
1_Python Basics.pdf1_Python Basics.pdf
1_Python Basics.pdf
 
Introduction to Python
Introduction to Python  Introduction to Python
Introduction to Python
 

Mehr von lotlot

Pseudocode-Flowchart
Pseudocode-FlowchartPseudocode-Flowchart
Pseudocode-Flowchart
lotlot
 
Form Script
Form ScriptForm Script
Form Script
lotlot
 
Mysql Aggregate
Mysql AggregateMysql Aggregate
Mysql Aggregate
lotlot
 
Mysql Script
Mysql ScriptMysql Script
Mysql Script
lotlot
 
Php Form
Php FormPhp Form
Php Form
lotlot
 
Php Loop
Php LoopPhp Loop
Php Loop
lotlot
 
Php Condition Flow
Php Condition FlowPhp Condition Flow
Php Condition Flow
lotlot
 
Hariyali - India
Hariyali - IndiaHariyali - India
Hariyali - India
lotlot
 
The Province Of Davao Oriental
The Province Of Davao OrientalThe Province Of Davao Oriental
The Province Of Davao Oriental
lotlot
 
Annual Review
Annual ReviewAnnual Review
Annual Review
lotlot
 

Mehr von lotlot (11)

Pseudocode-Flowchart
Pseudocode-FlowchartPseudocode-Flowchart
Pseudocode-Flowchart
 
Form Script
Form ScriptForm Script
Form Script
 
Mysql Aggregate
Mysql AggregateMysql Aggregate
Mysql Aggregate
 
Mysql Script
Mysql ScriptMysql Script
Mysql Script
 
Mysql
MysqlMysql
Mysql
 
Php Form
Php FormPhp Form
Php Form
 
Php Loop
Php LoopPhp Loop
Php Loop
 
Php Condition Flow
Php Condition FlowPhp Condition Flow
Php Condition Flow
 
Hariyali - India
Hariyali - IndiaHariyali - India
Hariyali - India
 
The Province Of Davao Oriental
The Province Of Davao OrientalThe Province Of Davao Oriental
The Province Of Davao Oriental
 
Annual Review
Annual ReviewAnnual Review
Annual Review
 

Kürzlich hochgeladen

Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Kürzlich hochgeladen (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

Php-Continuation

  • 1. PHP: Hypertext Preprocessor The Building Blocks
  • 2. Special Data Types Resource - Reference to a third-party resource (a database, for example) NULL - An uninitialized variable Sample <?php $testing; // declare without assigning print gettype( $testing ); // NULL ?>
  • 3. PHP’s Type Functions var_dump()- tells you a variable's type and its contents Sample <php $testing = 5; var_dump( $testing ); ?>
  • 4. PHP’s Type Functions gettype()function - to acquire the type of any variable. If you place a variable between the parentheses of the function call, gettype() returns a string representing the relevant type (NULL, integer, string, double , boolean) Sample <?php $testing = 5; print gettype( $testing ); // integer ?>
  • 5. PHP’s Type Functions settype()function - to change the type of a variable. To use settype(), you must place the variable to change (and the type to change it to) between the parentheses and separate them by commas Sample <?php $undecided = 3.14; settype( $undecided, double ); print gettype( $undecided ); print " -- $undecided<br />"; // 3.14 ?>
  • 6. Operators and Expressions Operators- are symbols that enable you to use one or more values to produce a new value. A value that is operated on by an operator is referred to as an operand. 4+3   Expression- is any combination of functions, values, and operators that resolves to a value. 4+3=9 $user=you; gettype( $user);   Assignment Operator - takes the value of its right operand and assigns it to its left operand $name = "matt";
  • 7. Operators and Expressions Arithmetic Operators - The addition operator adds the right operand to the left operand, whereas the subtraction operator subtracts the right operand from the left. The division operator divides the left operand by the right, and the multiplication operator multiplies the left operand by the right. The modulus operator returns the remainder of the left operand divided by the right. Example (+)Addition (-)Subtraction (/)Division (*) Multiplication (%)Modulus
  • 8. Concatenation Operator The concatenation operator is a single period (.). Treating both operands as strings, it appends the right operand to the left Sample "hello"." world" is equivalent to "hello world" $centimeters = 212; print "the width is ".($centimeters/100)." meters";
  • 9. Combined Assignment Operator consists of a standard operator symbol followed by an equals sign. Example $x = 4;$x = $x + 4; // $x now equals 8 can instead be written as $x = 4;$x += 4; // $x now equals 8
  • 10. Comparison Operators perform tests on their operands. They return the boolean value true if the test is successful and return false otherwise. This type of expression is useful in control structures, such as if and while statements Example $x=5.1 $x < 5
  • 11. Logical Operators To test combinations of booleans Sample true || false = true true && false = false
  • 12. Operator Precedence When you use an operator, the PHP engine usually reads your expression from left to right. Sample 4 + 5=9 4 + 5 * 2 = 18 or 4 + 5 * 2 = 14 or (4 + 5) * 2 = 18
  • 13. Constants Variables offer a flexible way of storing data because you can change their values and the type of data they store at any time. If, however, you want to work with a value that you do not want to alter throughout your script's execution, you can define a constant. You must use PHP's built-in function define() to create a constant. After you have done this, the constant cannot be changed. To use the define() function, you must place the name of the constant and the value you want to give it within the call's parentheses. These values must be separated by a comma, like so: Example define ("CONSTANT_NAME", 42); <?php define ("USER", "Gerald"); print "Welcome".USER; ?>