Home > Article > Backend Development > Detailed explanation of integer variables of PHP data types
The integer type is Interger. In 32-bit operating systems, the valid range is -2146483648~+2146483646. The integer value can be specified in decimal, hexadecimal or octal, and can be preceded by an optional symbol "-" or "+" to indicate positive or negative. If octal notation is used, 0 must be added before the number; if hexadecimal notation is used, 0x must be added before the number, as shown in Program 2-5.
$a=123; #Decimal system
$b=-456; #A negative number
$c=0135; #Octal number (equal to decimal 93)
$d=0x1b; #Hexadecimal system Number (equal to decimal 27)
echo $a."
".$b."
".$c."
".$d;
?>
The above is PHP For a detailed explanation of the data type of integer variables, please pay attention to the PHP Chinese website (www.php.cn) for more related content!