click here to open sidebar
Php data type – variable store different type of data.
Different data type can do different things.
Data type are give below.
A string is a sequence of characters, like “Hello, how are you!”
A string of text should be in single or double quotes.
constants example
";
echo $b;
?>
An integer data type is a non-decimal number between -2,147,483,648 and 2,147,483,647.
php integer
float data type is a use for point number.
php float
boolean represent the two statement. True or False
boolean datatype
Multiple value store in single variable.
Below given multiple car name store in single variable.
array datatype
Object datatype store value and information.
First of we need to declare class of object.
Class contain object value.
Then create a new object.
Pass the value in object by statement
object datatype
model = "Xtream";
}
}
// create an object
$xbike = new Bike();
// show object properties
echo $xbike->model;
?>
Null datatype contain null value.
Variable have no any store the value.
If variable created without any value, It mean this variable assigned the Null value.
Null datatype