Php Variables and its data types | Php tutorials

                           Bestitworriors




Php Variables and its data types


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



  1. Php support string data type
  2. Php support Integer data types
  3. Php support Float data types
  4. Php support Boolean data types
  5. Php support Array data types
  6. Php support Object data types
  7. Php support Null data types
  8. 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



I hope You really enjoyed this blog . I try my best to make every thing is easy and helpfull to provide to public .You will get more blog about the Programing project and code . Thanks for visiting my blog if you have any querry related to this you can comment here i will try my best to response you back