Phpmysql 04 PHP Data Types
Phpmysql 04 PHP Data Types
$num1 = 123;
$num3 = 0123; // octal integer
Integer:
Signed integers:
These are integers that can be both positive and negative.
They are represented in PHP using
the 'int' or 'integer' keyword.
Hexadecimal integers:
These are integers that are represented in base-16. They
are began with '0x' or '0X' and can contain the
digits 0−90−9 and the letters A−F.
Example of PHP Integer
Integer:
Signed integers:
These are integers that can be both positive and negative.
They are represented in PHP using
the 'int' or 'integer' keyword.
Hexadecimal integers:
These are integers that are represented in base-16. They
are began with '0x' or '0X' and can contain the
digits 0−90−9 and the letters A−F.
float
Float (floating point number) is a number with a decimal
point or a number in exponential form.
In the following example $x is a float.
In floating point data type rule x variable must store
decimal point number like 0.4567 or 567.78
Example of floating point
number
PHP Boolean
A Boolean represents two possible states: TRUE or FALSE.
$x = true;
$y = false;