Integer Data Type:
In PHP integer is single-value type. Integers are whole numbers. Its range varies according to your platform. But you can use any number from -2,147,483,648 to +2,147,483,647. Integer can be written in decimal, octal and hexadecimal. In decimal we can represent integer without zero.
In octal integer can be represented with a leading 0 and a sequence of digits from 0 to 7.
In hexadecimal integer can be represented with 0-9 and alphabets A-F.
In php we just assign a value to a variable and on the basis of that value data type is confirmed.
Assigning integer values using different syntaxes in PHP:
We can assign integer values to a variable. In php we use different syntaxes for assigning integer values.
$a = 1234; //as a decimal number
$a = -123; //as a negative number
$a = 0123; //as a octal number (equivalent to 83 decimal)
$a = 0x12; //as a hexadecimal number (equivalent to 18 decimal)
Above is the simple code to assign integer values using different syntaxes in PHP.
This simple article tells that how assign integer values using different syntaxes in PHP.
Assign integer using different syntaxes in PHP