Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

PHP Integer

An integer data type is a non-decimal number that ranges from -2,147,483,648 to 2,147,483,647.

Rules for integers:

  • An integer must contain at least one digit.
  • An integer cannot have a decimal point.
  • An integer can be either positive or negative.
  • Integers can be represented in decimal (base 10), hexadecimal (base 16), octal (base 8), or binary (base 2) notation.

In the following example, $x is an integer. The PHP var_dump() function will return its data type and value:

Example

$x = 5985;
var_dump($x);