Best to know

  • PHP Integers

    2, 256, -256, 10358, -179567 are all integers.

    An integer is a number without any decimal part.

    An integer data type is a non-decimal number between -2147483648 and 2147483647 in 32 bit systems, and between -9223372036854775808 and 9223372036854775807 in 64 bit systems. A value greater (or lower) than this, will be stored as float, because it exceeds the limit of an integer.

    Note: Another important thing to know is that even if 4 * 2.5 is 10, the result is stored as float, because one of the operands is a float (2.5).

    Here are some rules for integers:

  • An integer must have at least one digit
  • An integer must NOT have a decimal point
  • An integer can be either positive or negative
  • Integers can be specified in three formats: decimal (base 10), hexadecimal (base 16 - prefixed with 0x), octal (base 8 - prefixed with 0) or binary (base 2 - prefixed with 0b)

PHP has the following predefined constants for integers:

  • PHP_INT_MAX - The largest integer supported
  • PHP_INT_MIN - The smallest integer supported
  • PHP_INT_SIZE -  The size of an integer in bytes

PHP has the following functions to check if the type of a variable is integer:



Leave A Comment


Last Visited Articles


Info Board

Visitor Counter
0
 

Todays visit

41 Articles 2410 RSS ARTS 13 Photos

Popular News

🚀 Welcome to our website! Stay updated with the latest news. 🎉

United States

18.191.15.43 :: Total visit:


Welcome 38.393.35.43 Click here to Register or login
Oslo time:2025-04-03 Whos is online (last 10 min): 
1 - United States - 48.58.88.858
2 - United States - 3.220.998.966
3 - United States - 300.28.333.234
4 - United States - 88.884.838.878
5 - United States - 3.222.225.250
6 - United States - 34.203.333.35
7 - United States - 44.200.002.204
8 - United States - 55.55.77.569
9 - United States - 56.83.260.58
10 - United States - 66.245.77.545
11 - United States - 11.219.77.112
12 - United States - 66.249.77.323
13 - Singapore - 666.669.665.696
14 - Singapore - 000.009.030.205
15 - Singapore - 444.449.448.40
16 - United States - 44.449.442.45
17 - United States - 52.447.444.447
18 - United States - 58.259.258.55
19 - United States - 58.588.523.555
20 - United States - 3.555.7.9
21 - United States - 18.191.15.43


Farsi English Norsk RSS