Php Variables and its data types | Php tutorials
Bestitworriors
Php Variables and its data types | Php tutorials Bestitworriors - Php support almost all data types.Php support data types of String,Integer,Float,Boolean,Array,Object,NULL.Data types tell about the data and information format . Which type of data store in variables like it contain integer or number data value or some strings or text data or anything else.Php Var_dump() use to get the type of data or variables.
Some Key Points of Php Data types
- Php support string data type
- Php support Integer data types
- Php support Float data types
- Php support Boolean data types
- Php support Array data types
- Php support Object data types
- Php support Null data types
- Php function get the data types of variable
Code
<?php
$stringtype = 'Hello Best It Worrior';
echo var_dump($stringtype);
echo "<br>";
//Integer
$Integertype = 5985;
echo var_dump($Integertype);
echo "<br>";
//Float (floating point numbers - also called double)
$floattype = 59.85;
echo var_dump($floattype);
echo "<br>";
//Boolean
$booleantype1 = true;
$booleantype2 = false;
echo var_dump($booleantype1);
echo "<br>";
echo var_dump($booleantype2);
echo "<br>";
//Array
$arraytype = array("Item1","Item2","Item3");
echo var_dump($arraytype);
echo "<br>";
//NULL
$nulltype = null;
echo var_dump($nulltype);
echo "<br>";
?>
OutPut
string(21) "Hello Best It Worrior"
int(5985)
float(59.85)
bool(true)
bool(false)
array(3) { [0]=> string(5) "Item1" [1]=> string(5) "Item2" [2]=> string(5) <"Item3" }
NULL
int(5985)
float(59.85)
bool(true)
bool(false)
array(3) { [0]=> string(5) "Item1" [1]=> string(5) "Item2" [2]=> string(5) <"Item3" }
NULL
0 Comments