PHP Data Types

By Solve Program

PHP Data Types

PHP Programming
PHP Programming

PHP can store more data types that's means more different thinks and function. PHP support the following data type :
  • String
  • Integer
  • Float (This like double)
  • Boolean
  •  Array
  • Null
  • Object
  • Resource

PHP String

PHP String is used for text data type like Hello World!. Example



PHP Integer

PHP integer is used for value of non-decimal number. Rule of PHP integer is must have one least of digit, not have a decimal, can be used for negative and positive number, and can be specified three format that's 10-based decimal, 16-based prefixed with 0x hexadecimal or 8-based - prefixed with 0 octal. Example :


PHP Float

PHP float is used for decimal number like 1.5, etc. Example :


PHP Boolean

PHP boolean is used for true and false statement. Example :


PHP Array

PHP array is used for multiple value in one variable. Example :


PHP Null

PHP null is used for variable that has not a value or has NULL value. Example :


PHP Object

PHP object is a adta type which stores data on how process the data. First that must declared in new class. A class is structure that can used contain properties and method. Example :

PHP Resource

PHP resource is a special resource data type and not actual data type. PHP resource is storing a reference to function and external resource to PHP.