PHP Tutorial Tutorials - PHP Variable Types

PHP Variable Types

PHP supports ten primitive types.

Type Desc Example
Integers Numbers 1999, 100
Float floating-point numbers. 3.1415926
Booleans either true or false TRUE,FALSE
NULL special type NULL
Strings series of characters "hello php"
Arrays an ordered map array('key'=>'value')
Iterables Iterable is a pseudo-type
Objects are instances of programmer-defined classes $bar = new foo;
Resources A resource is a special variable, holding a reference to an external resource.
(ie,mysql connections)
Callbacks / Callables Some functions accept user-defined callback functions as a parameter
Date:2019-09-30 18:10:04 From:www.Lautturi.com author:Lautturi