Home  >  Article  >  Backend Development  >  Detailed explanation of integer variables of PHP data types

Detailed explanation of integer variables of PHP data types

黄舟
黄舟Original
2016-12-22 10:26:261762browse

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!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn