PHP Different Data Types!!
In this article we will discuss about Data types in PHP.
Data - types In PHP
Integer are numbers without any fraction. like 145
It stores negative and positive number.
It can be decimal, hexadecimal and octal.
Variable declared or define with $ sign in php.
Program :
Output :
7
7
as shown in above program we declare two integers x and y and print sum of it.
Strings
String is a sequence of characters.
String is declared in a quotation (" ").
Program :
Output :
string stored in string1 variable
Array
Array is a sequence of variables for same data type values.
PHP has three type of array
1) numeric array
2) Associative array
3) Multidimensional array
PHP has three type of array
1) numeric array
2) Associative array
3) Multidimensional array
Output :
0
1
2
hello
Array can stores number, characters and strings.
In above example we store number in which there is no need of quote (" ") and in string it can be stored in single or double quotations.
After that we can display whole array as well as a particular array with it's index number.
Double
Doubles print the minimum number of decimal places needed.
Program :
Output : 5.09
Boolean
Boolean has only two possible values True or False.
Mostly, it is used for conditional statements.
If condition is true then it returns true and if condition is false then it returns false.
Program :
Output : 1
As shown in above program when the value is true then it return 1.
When value of variable is false then it stored null value.
NULL
Null value assign the value of variable is NULL.
It means we assign no value to the variable.
When we create a variable without assign value, by default it stores null.
Program :
Output of this program will blank page. because we set null value of a.
Objects :
Object is a instance of a class.
class must contain a function and property.
we use new keyword with class name for create object.
Program :
Output :
function called
function called
As shown in above program we create a class with function b.
After that we create an object of class b it executes the function b.
Resources
PHP Resources is a storing of a reference to the functions.
it is not the actual data type.
You Can Also Search For :
Mesothelioma Survival Rates , Mesothelioma Attorneys California , Seattle Mesothelioma Lawyer , Mesothelioma Suit , Mesothelioma Claim , Wisconsin Mesothelioma Attorney , Mesothelioma Attorney illinois , Mesothelioma Trial Attorney ,Houston Mesothelioma Attorney , Mesothelioma Lawyer Dallas , New York Mesothelioma Law Firm,Mesothelioma Lawyer Asbestos Cancer Lawsuit , Mesothelioma Lawyers San Diego,Mesothelioma Litigation , Mesothelioma Attorney Assistance , Mesothelioma Lawyer Asbestos Cancer Lawsuit , Mesothelioma Lawyer Chicago , New York Mesothelioma Law Firm ,
Houston Mesothelioma Attorney , Mesothelioma Lawyer Dallas , Mesothelioma Care , Mesothelioma Trial Attorney , Mesothelioma Lawyer Texas , Lawsuit Mesothelioma , Truck Accident Attorney Los Angeles ,Asbestos Exposure Lawyers , Mesothelioma Cases , Emergency Response Plan ppt , Mesothelioma Lawyers San Diego , Asbestos Mesothelioma Lawsuit , Tennessee Mesothelioma Lawyer , Meso Lawyer , Mesothelioma Settlements Amounts , Mesothelioma Law Firms , New Mexico Mesothelioma Lawyer , Accident Attorneys Orange County , Mesothelioma Lawsuit ,Personal Injury Accident Lawyer , Purchase Structured Settlements , Firm Law Mesothelioma , Car Accident Lawyers Los Angeles , Mesothelioma Attorneys , Structured Settlement Company , Auto Accident Lawyer San Francisco , Mesotheolima , Los Angeles Motorcycle Accident Lawyer
Mesothelioma , Mesothelioma Lawyer Virginia , Seattle Mesothelioma Lawyer , Mesothelioma Attorney illinois , Mesothelioma Drug , Mesothelioma Attorney DirectoryMesothelioma Settlements , Mesothelioma Help , Mesothelioma ct , Mesothelioma Attorney Florida , Washington Mesothelioma Attorney , Best Mesothelioma Lawyers , Diagnosed With Mesothelioma , Mesothelioma Settlement Amounts , Mesothelioma Personal Injury Lawyers , Mesothelioma Compensation , Attorney Lawyer Mesothelioma ,Colorado Mesothelioma Lawyers,Mesothelioma Lawsuits , Mesothelioma Claims , Average Mesothelioma Settlement , Average Mesothelioma Settlement , Mesothelioma Law Suit , Alabama Mesothelioma Lawyer , alabama Mesothelioma Lawyer , utah mesothelioma lawyer , Dallas Mesothelioma Lawyer , Mesothelioma Attorney California , Mesothelioma Lawyer California ,Mesothelioma Survival Rates ,
Mesothelioma Attorneys California, Wisconsin Mesothelioma Attorney Mesotheliama , Mesothelioma Lawyer Virginia , Seattle Mesothelioma Lawyer , Mesothelioma Attorney illinois, Mesothelioma Trial Attorney Injury Lawyer Houston tx , Baltimore Mesothelioma Attorneys , Mesothelioma Care ,Mesothelioma Trial Attorney ,Mesothelioma Lawyer Texas , Mesothelioma Lawyer Dallas , Mesothelioma Care , Mesothelioma Trial Attorney , Mesothelioma Lawyer Texas , California Mesothelioma Attorney Philadelphia Mesothelioma Lawyer , Illinois Mesothelioma Lawyer , Mesothelioma Attorney , Mesothelioma Claims , Average Mesothelioma Settlement
Integrated ehr , Mesothelioma Law Sui , Mesothelioma Lawyer California,Mesothelioma Attorney California ,Mesothelioma Law Suits ,Dallas Mesothelioma Attorneys ,Mesothelioma Drug ,Mesothelioma Attorney Directory