PHP 

PHP data type is used for storing a data in a different form and PHP support all types of data type as comparison other programming language such as- C, JAVA, .Net

  1. String
  2. Integer
  3. Float
  4. Boolean
  5. Array
  6. Object
  7. NULL
  8. Resource

PHP String: A string just like a characters and a string can be any text inside quotes. You can use single or double quotes.

<?php
$a = “Hello Mom and dad!”;
echo $a;
?>

PHP Integer: Integer is a number value for example 1233.

<?php
$a = 1225;
var_dump($a);
?>

PHP Float: A float (floating point number) is a number with a decimal point.

<?php
$a = 14.25;
var_dump($a);
?>

PHP Boolean: A Boolean represents two possible states: TRUE or FALSE..

<?php
$a = true;
$b = false;
?>

PHP Array:

<?php
$alphabets = array(“A”,”B”,”C”);
var_dump($alphabets );
?>

PHP Object:

<?php
class Alphabets{
function Alphabets() {
$this->character= “A”;
}
}
// create an object
$obj = new Alphabets();

// show object properties
echo $obj ->character;
?>

PHP Null:

Null is a special data type which can have only one value: NULL.

<?php
$a = “Hello india!”;
$a = null;
var_dump($a);
?>

News Reporter
IT Software and web development, Core PHP, JavaScript, JQuery, HTML, CSS, CakePHP, Angularjs, Codeigniter etc.

Leave a Reply

Your email address will not be published. Required fields are marked *

error: