Showing posts with label multidimensional array. Show all posts
Showing posts with label multidimensional array. Show all posts

Thursday, 26 December 2013

PHP Variable & Data Types | Chapter 2 Cont.



Boolean - It is a data type containing two values which is TRUE (1) & FALSE (0) . They are mainly used to compare conditions for use in conditional statements

php boolean













 General Syntax -
$variable=True;
$variable=False;



 Integer - It is a data type containing numbers. Integers can be defined in three formats which is Decimal, hexadecimal & octal. An integer can be both positive or negative.

General Syntax -
$variable = decimal number;
$variable = negative number ;
$variable = octal number ;
$variable = hexadecimal number;




Example -
<?php
$variable = 1234; // decimal number (base 10)
$variable = -123; // a negative number
$variable = 0123; // octal number (equivalent to 83 decimal) (base 8)
$variable = 0x1A; // hexadecimal number (equivalent to 26 decimal) (base 16)
?>




Float - A number containing a decimal point is known as Float Value. They can be positive or negative.

General Syntax -
$variable = 10.365;