डिप्लोमा इन ऑफिस मैनेजमेंट एण्ड अकाउटिंग

डिप्लोमा इन ऑफिस मैनेजमेंट एण्ड अकाउटिंग

Full Stack Web Development with Laravel

Full Stack Web Development with Laravel

Affiliate Program

Affiliate Program

Data type in php

In any programming language, data type gives information about what type of data and how much data will hold in particular variable memory.
PHP supports the following types of data types.
  • Integer
  • Float
  • boolean
  • string
  • array
  • object
  • null
<?php 

// for integer
$age=20;
var_dump($age);

// for float
$salary=45656.45;
var_dump($salary);


// for boolean
$isLogin=false;
var_dump($isLogin);


// for string
$name="almora";
var_dump($name);


// for array
$persons=["aman","ajay","kamal"];
var_dump($persons);

// for object
class Car{
public $name="BMW";
}

$c=new Car();
var_dump($c);

// for null
$address=null;
var_dump($address);
?>
© 2016 - 2023, All Rights are Reserved.