Programming
C
C++
Java
Python
Web Technology
JavaScript
PHP
HTML
CSS
Database
SQL
ORACLE
DWH
Practice
Html
Css
Php
JavaScript
Example
C
C++
Python
Java
JavaScript
PHP
HTML
CSS
SQL
Interview Que
C
C++
Python
Java
JavaScript
PHP
HTML
CSS
SQL
More
About Me
Contact Us
☰
HOME
USER CORNER
CONTACT | HELP
ABOUT AIMTOCODE
PHP BASICS
PHP INTRODUCTION
PHP EVALUATION
PHP SYNTAX
PHP VARIABLE
PHP CONSTANT
PHP FUNCTION
BUILT-IN FUNCTION
USER DEFINED FUNCTION
ERROR HANDLING
PHP DATA TYPES
PHP INTEGER DATATYPE
PHP DOUBLE DATATYPE
PHP STRING DATATYPE
PHP NULL DATATYPE
PHP BOOLEAN DATATYPE
PHP ARRAY DATATYPE
PHP OBJECT DATATYPE
PHP RESOURCE DATATYPE
PHP CONTROL STATEMENT
SIMPLE IF STATEMENT
PHP IF-ELSE STATEMENT
PHP ELSE-IF STATEMENT
PHP SWITCH STATEMENT
PHP LOOP STATEMENT
PHP WHILE LOOP
PHP DO-WHILE LOOP
PHP FOR-LOOP
PHP FOREACH LOOP
PHP OPERATORS
ARITHMETIC OPERATOR
LOGICAL OPERATORS
ASSIGNMENT OPERATOR
INCREMENT OPERATOR
DECREMENT OPERATOR
STRING OPERATOR
ARRAY OPERATOR
PHP-FILE HANDLING
FILE READ FUNCTION
FILE WRITE FUNCTION
FILE OPEN FUNCTION
FILE CLOSE FUNCTION
FILE COPY FUNCTION
FILE DELETE FUNCTION
PHP ERRORS
PHP Integer Data Type With Examples
Integer Data Type:
Rules for integers:
The range of integers must lie between -2^31 to 2^31.
Integers are whole numbers, without a decimal point (..., -2, -1, 0, 1, 2, ...).
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 (10-based), hexadecimal (16-based - prefixed with 0x) or octal (8-based - prefixed with 0)
Notation
Preceded with
Example
Decimal
128
Hexadecimal
0x
0x80
Octal
0
0200
Binary
0b
0b10000000
Example:
Result:
int(123) int(-123) int(26) int(83)
Read More:
Floating-Data-Type
String-Data-Type
Booleans-Data-Type
Array-Data-Type
Object-Data-Type
Resource-Data-Type
Null Data Type