Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the int integer type in PHP

Shulou Source: shulou.com Published: 2022-06-01 13:10:45 10月02日 Update

This article mainly shows you "how to use int integer types in PHP". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn how to use int integer types in PHP.

Description: int is a collection of positive, 0, and negative numbers. The integers stored in php are decimal, octal, and hexadecimal.

Syntax: $var = integer

Octal: add 0 before the number, which is octal. The number is only 0-7.

/ / Octal $num = 0123; var_dump ($num); / / 83 calculation: 1 "8" 8 + 2 "8 + 3

Hexadecimal writing: adding 0x before the number is hexadecimal. The only number is 0123456789abcdef.

/ / hexadecimal $num = 0x123 × varnished dump ($num); / / 291Computation: 1 "16" 16 + 2 "16 + 3"

The maximum storage integer value of php is more than 2.1 billion.

Echo PHP_INT_MAX; / / 2147483647

PHP maximum integer digits: 14 digits.

Echo PHP_INT_SIZE; / / 4 above is all the content of the article "how to use int integer types in PHP". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Integers numbers types octal content hexadecimal articles binary maximum writing only that is numerical values storage learning help digits easy to understand more organized Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Tech Info Linux Apple Shulou Technology