SlideShare a Scribd company logo
DATA TYPES IN PHP 1 WWW.USTUDY.IN
Data type A data type refers to the type of data a variable can store. PHP has eight (8) different data types integer numbers floating point numbers strings Booleans arrays objects resources null 2 WWW.USTUDY.IN
Integer The integer data type is used to specify a numeric value without a fractional component.  you can declare as given belowinteger $variable;  	$variable =10; 3 WWW.USTUDY.IN
Real Number It is also known as a floating number or floating point number. It is not a whole number and has fractions such as 1.22, 2.45, 100.765 etc. Some examples of valid floating point numbers include:  3.14  0.001  -1.234  0.314E2 // 31.4  1.234E-5 // 0.00001234  -3.45E-3 // -0.00345  4 WWW.USTUDY.IN
Boolean  Boolean values are true or false, also 0 and empty string evaluates to false, and any numeric value rather than zero, or a string that is not empty evaluates to true.  you can declare as given belowBoolean $variable; where Boolean denotes the type of the variable. 5 WWW.USTUDY.IN
String  String values are sequence of characters, included in a single quote or double quotes, for example,  $str1 = "This is a string data type variable"; A string literal can be specified in four different ways:  single quoted  double quoted  heredoc syntax  nowdoc syntax  6 WWW.USTUDY.IN
Single quoted The simplest way to specify a string is to enclose it in single quotes     Example: 		   <?php		echo 'this is a simple string';	    ?> WWW.USTUDY.IN 7
Double quoted If the string is enclosed in double-quotes ("), Example: “This is  a string”, this will evaluate to:  This is a string  WWW.USTUDY.IN 8
Here Documents The heredoc string structure is a method of including larger strings inside the code. we can use it to include content of any length.  To create a heredoc, use a special operator that is made up of three left brackets ( <<< ). The syntax is as follows:  $longString = <<< termination_marker any amount of content termination_marker;  9 WWW.USTUDY.IN
Nowdoc Nowdocs are to single-quoted strings what heredocs are to double-quoted strings.  A nowdoc is specified similarly to a heredoc, but no parsing is done inside a nowdoc. 10 WWW.USTUDY.IN
Array  An array in PHP is actually an ordered map. A map is a type that associates values to keys. This type is optimized for several different uses; it can be treated as an array, list (vector), hash table (an implementation of a map), dictionary, collection, stack, queue, and probably more. As array values can be other array s, trees and multidimensional array s are also possible.  WWW.USTUDY.IN 11
Resource  Resources are not an actual data type, but the storing of a reference to functions and resources external to PHP. The most common example of using the resource data type is a database call.  12 WWW.USTUDY.IN
Null  Null is a special data type which can have only one value, which is itself. Which is to say, null is not only a data type, but also a keyword literal. A variable of data type null is a variable that has no value assigned to it.  WWW.USTUDY.IN 13
The End 14 WWW.USTUDY.IN

More Related Content

What's hot

Introduction to php
Introduction to phpIntroduction to php
Introduction to php
Taha Malampatti
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
Nidhi mishra
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
Ravinder Kamboj
 
PHP variables
PHP  variablesPHP  variables
PHP variables
Siddique Ibrahim
 
PHP - Introduction to PHP Forms
PHP - Introduction to PHP FormsPHP - Introduction to PHP Forms
PHP - Introduction to PHP Forms
Vibrant Technologies & Computers
 
PHP FUNCTIONS
PHP FUNCTIONSPHP FUNCTIONS
PHP FUNCTIONS
Zeeshan Ahmed
 
Class 5 - PHP Strings
Class 5 - PHP StringsClass 5 - PHP Strings
Class 5 - PHP Strings
Ahmed Swilam
 
Interface in java
Interface in javaInterface in java
Interface in java
PhD Research Scholar
 
SQL, Embedded SQL, Dynamic SQL and SQLJ
SQL, Embedded SQL, Dynamic SQL and SQLJSQL, Embedded SQL, Dynamic SQL and SQLJ
SQL, Embedded SQL, Dynamic SQL and SQLJ
Dharita Chokshi
 
Data Types & Variables in JAVA
Data Types & Variables in JAVAData Types & Variables in JAVA
Data Types & Variables in JAVA
Ankita Totala
 
Php with MYSQL Database
Php with MYSQL DatabasePhp with MYSQL Database
Php with MYSQL Database
Computer Hardware & Trouble shooting
 
Wrapper class
Wrapper classWrapper class
Wrapper class
kamal kotecha
 
Operators php
Operators phpOperators php
Operators php
Chandni Pm
 
PHP Loops and PHP Forms
PHP  Loops and PHP FormsPHP  Loops and PHP Forms
PHP Loops and PHP Forms
M.Zalmai Rahmani
 
Pointers in c++
Pointers in c++Pointers in c++
Pointers in c++
Vineeta Garg
 
PHP
PHPPHP
PHP - Introduction to File Handling with PHP
PHP -  Introduction to  File Handling with PHPPHP -  Introduction to  File Handling with PHP
PHP - Introduction to File Handling with PHP
Vibrant Technologies & Computers
 

What's hot (20)

Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
PHP variables
PHP  variablesPHP  variables
PHP variables
 
Operators in PHP
Operators in PHPOperators in PHP
Operators in PHP
 
PHP - Introduction to PHP Forms
PHP - Introduction to PHP FormsPHP - Introduction to PHP Forms
PHP - Introduction to PHP Forms
 
PHP FUNCTIONS
PHP FUNCTIONSPHP FUNCTIONS
PHP FUNCTIONS
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
Class 5 - PHP Strings
Class 5 - PHP StringsClass 5 - PHP Strings
Class 5 - PHP Strings
 
Interface in java
Interface in javaInterface in java
Interface in java
 
SQL, Embedded SQL, Dynamic SQL and SQLJ
SQL, Embedded SQL, Dynamic SQL and SQLJSQL, Embedded SQL, Dynamic SQL and SQLJ
SQL, Embedded SQL, Dynamic SQL and SQLJ
 
Data Types & Variables in JAVA
Data Types & Variables in JAVAData Types & Variables in JAVA
Data Types & Variables in JAVA
 
Php with MYSQL Database
Php with MYSQL DatabasePhp with MYSQL Database
Php with MYSQL Database
 
Wrapper class
Wrapper classWrapper class
Wrapper class
 
Operators php
Operators phpOperators php
Operators php
 
PHP Loops and PHP Forms
PHP  Loops and PHP FormsPHP  Loops and PHP Forms
PHP Loops and PHP Forms
 
Pointers in c++
Pointers in c++Pointers in c++
Pointers in c++
 
PHP
PHPPHP
PHP
 
PHP - Introduction to File Handling with PHP
PHP -  Introduction to  File Handling with PHPPHP -  Introduction to  File Handling with PHP
PHP - Introduction to File Handling with PHP
 

Similar to Data types in php

Data types
Data typesData types
Data types
Sachin Satwaskar
 
Computer programming 2 Lesson 5
Computer programming 2  Lesson 5Computer programming 2  Lesson 5
Computer programming 2 Lesson 5
MLG College of Learning, Inc
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
Mohammed Khan
 
Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive
Raj Naik
 
Literals, primitive datatypes, variables, expressions, identifiers
Literals, primitive datatypes, variables, expressions, identifiersLiterals, primitive datatypes, variables, expressions, identifiers
Literals, primitive datatypes, variables, expressions, identifiers
Tanishq Soni
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm
KristinaBorooah
 
Data Type is a basic classification which identifies.docx
Data Type is a basic classification which identifies.docxData Type is a basic classification which identifies.docx
Data Type is a basic classification which identifies.docx
theodorelove43763
 
Chap1introppt2php(finally done)
Chap1introppt2php(finally done)Chap1introppt2php(finally done)
Chap1introppt2php(finally done)
monikadeshmane
 
Pointers on data structure in computer science.ppt
Pointers on data structure in computer science.pptPointers on data structure in computer science.ppt
Pointers on data structure in computer science.ppt
MdSabbirAhmedEkhon
 
Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Types
k v
 
Datatypes in c
Datatypes in cDatatypes in c
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data typesManisha Keim
 
c++ arrays and pointers grade 9 STEP curriculum.pptx
c++ arrays and pointers grade 9 STEP curriculum.pptxc++ arrays and pointers grade 9 STEP curriculum.pptx
c++ arrays and pointers grade 9 STEP curriculum.pptx
JanineCallangan
 
C data types, arrays and structs
C data types, arrays and structsC data types, arrays and structs
C data types, arrays and structs
Saad Sheikh
 
DATA TYPES IN C Language.pptx
DATA TYPES IN C Language.pptxDATA TYPES IN C Language.pptx
DATA TYPES IN C Language.pptx
karansethi63
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
Bhaktaraz Bhatta
 
COMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdf
COMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdfCOMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdf
COMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdf
rajkumar2792005
 
13- Data and Its Types presentation kafss
13- Data and Its Types presentation kafss13- Data and Its Types presentation kafss
13- Data and Its Types presentation kafss
AliKhokhar33
 
Basic data types in python
Basic data types in pythonBasic data types in python
Basic data types in python
sunilchute1
 

Similar to Data types in php (20)

Data types
Data typesData types
Data types
 
Computer programming 2 Lesson 5
Computer programming 2  Lesson 5Computer programming 2  Lesson 5
Computer programming 2 Lesson 5
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive
 
Literals, primitive datatypes, variables, expressions, identifiers
Literals, primitive datatypes, variables, expressions, identifiersLiterals, primitive datatypes, variables, expressions, identifiers
Literals, primitive datatypes, variables, expressions, identifiers
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm
 
Data Type is a basic classification which identifies.docx
Data Type is a basic classification which identifies.docxData Type is a basic classification which identifies.docx
Data Type is a basic classification which identifies.docx
 
Chap1introppt2php(finally done)
Chap1introppt2php(finally done)Chap1introppt2php(finally done)
Chap1introppt2php(finally done)
 
Pointers on data structure in computer science.ppt
Pointers on data structure in computer science.pptPointers on data structure in computer science.ppt
Pointers on data structure in computer science.ppt
 
Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Types
 
Datatypes in c
Datatypes in cDatatypes in c
Datatypes in c
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
 
c++ arrays and pointers grade 9 STEP curriculum.pptx
c++ arrays and pointers grade 9 STEP curriculum.pptxc++ arrays and pointers grade 9 STEP curriculum.pptx
c++ arrays and pointers grade 9 STEP curriculum.pptx
 
C data types, arrays and structs
C data types, arrays and structsC data types, arrays and structs
C data types, arrays and structs
 
DATA TYPES IN C Language.pptx
DATA TYPES IN C Language.pptxDATA TYPES IN C Language.pptx
DATA TYPES IN C Language.pptx
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
COMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdf
COMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdfCOMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdf
COMPUTER SCIENCE SUPPORT MATERIAL CLASS 12.pdf
 
C++ data types
C++ data typesC++ data types
C++ data types
 
13- Data and Its Types presentation kafss
13- Data and Its Types presentation kafss13- Data and Its Types presentation kafss
13- Data and Its Types presentation kafss
 
Basic data types in python
Basic data types in pythonBasic data types in python
Basic data types in python
 

More from ilakkiya

History object
History objectHistory object
History objectilakkiya
 
Twisted pair cable
Twisted pair cableTwisted pair cable
Twisted pair cableilakkiya
 
Network topology
Network topologyNetwork topology
Network topologyilakkiya
 
Looping statement in vb.net
Looping statement in vb.netLooping statement in vb.net
Looping statement in vb.netilakkiya
 
Looping statement
Looping statementLooping statement
Looping statementilakkiya
 
Conditional statement
Conditional statementConditional statement
Conditional statementilakkiya
 
Array in php
Array in phpArray in php
Array in phpilakkiya
 
Decision statements in vb.net
Decision statements in vb.netDecision statements in vb.net
Decision statements in vb.netilakkiya
 
Addressing mode
Addressing modeAddressing mode
Addressing modeilakkiya
 

More from ilakkiya (10)

History object
History objectHistory object
History object
 
Twisted pair cable
Twisted pair cableTwisted pair cable
Twisted pair cable
 
Infrared
InfraredInfrared
Infrared
 
Network topology
Network topologyNetwork topology
Network topology
 
Looping statement in vb.net
Looping statement in vb.netLooping statement in vb.net
Looping statement in vb.net
 
Looping statement
Looping statementLooping statement
Looping statement
 
Conditional statement
Conditional statementConditional statement
Conditional statement
 
Array in php
Array in phpArray in php
Array in php
 
Decision statements in vb.net
Decision statements in vb.netDecision statements in vb.net
Decision statements in vb.net
 
Addressing mode
Addressing modeAddressing mode
Addressing mode
 

Recently uploaded

Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 

Recently uploaded (20)

Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 

Data types in php

  • 1. DATA TYPES IN PHP 1 WWW.USTUDY.IN
  • 2. Data type A data type refers to the type of data a variable can store. PHP has eight (8) different data types integer numbers floating point numbers strings Booleans arrays objects resources null 2 WWW.USTUDY.IN
  • 3. Integer The integer data type is used to specify a numeric value without a fractional component. you can declare as given belowinteger $variable; $variable =10; 3 WWW.USTUDY.IN
  • 4. Real Number It is also known as a floating number or floating point number. It is not a whole number and has fractions such as 1.22, 2.45, 100.765 etc. Some examples of valid floating point numbers include: 3.14 0.001 -1.234 0.314E2 // 31.4 1.234E-5 // 0.00001234 -3.45E-3 // -0.00345 4 WWW.USTUDY.IN
  • 5. Boolean Boolean values are true or false, also 0 and empty string evaluates to false, and any numeric value rather than zero, or a string that is not empty evaluates to true. you can declare as given belowBoolean $variable; where Boolean denotes the type of the variable. 5 WWW.USTUDY.IN
  • 6. String String values are sequence of characters, included in a single quote or double quotes, for example, $str1 = "This is a string data type variable"; A string literal can be specified in four different ways: single quoted double quoted heredoc syntax nowdoc syntax 6 WWW.USTUDY.IN
  • 7. Single quoted The simplest way to specify a string is to enclose it in single quotes Example: <?php echo 'this is a simple string'; ?> WWW.USTUDY.IN 7
  • 8. Double quoted If the string is enclosed in double-quotes ("), Example: “This is a string”, this will evaluate to: This is a string WWW.USTUDY.IN 8
  • 9. Here Documents The heredoc string structure is a method of including larger strings inside the code. we can use it to include content of any length. To create a heredoc, use a special operator that is made up of three left brackets ( <<< ). The syntax is as follows: $longString = <<< termination_marker any amount of content termination_marker; 9 WWW.USTUDY.IN
  • 10. Nowdoc Nowdocs are to single-quoted strings what heredocs are to double-quoted strings. A nowdoc is specified similarly to a heredoc, but no parsing is done inside a nowdoc. 10 WWW.USTUDY.IN
  • 11. Array An array in PHP is actually an ordered map. A map is a type that associates values to keys. This type is optimized for several different uses; it can be treated as an array, list (vector), hash table (an implementation of a map), dictionary, collection, stack, queue, and probably more. As array values can be other array s, trees and multidimensional array s are also possible. WWW.USTUDY.IN 11
  • 12. Resource Resources are not an actual data type, but the storing of a reference to functions and resources external to PHP. The most common example of using the resource data type is a database call. 12 WWW.USTUDY.IN
  • 13. Null Null is a special data type which can have only one value, which is itself. Which is to say, null is not only a data type, but also a keyword literal. A variable of data type null is a variable that has no value assigned to it. WWW.USTUDY.IN 13
  • 14. The End 14 WWW.USTUDY.IN