Detailed explanation of integer variables of PHP data types

黄舟
Release: 2023-03-03 21:10:01
Original
1768 people have browsed it

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!


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!