Data Types

PHP has three elemental types of data: integers, floating-point numbers, and strings of text. Integers are sometimes referred to as whole or natural numbers; they contain no decimal point. Floating-point numbers are sometimes called real numbers. They always contain a decimal point, even when only a zero follows it. PHP refers to these as doubles, which is short for double-precision floating-point numbers. Strings are collections of textual data. String constants are always surrounded by double quotes (") or single quotes (').

In addition to these, PHP has four aggregate data types that use the other three: arrays, objects and booleans, and resources. An array is a collection of values associated with indexes. Arrays are discussed ...

Get Core PHP Programming: Using PHP to Build Dynamic Web Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.