Chapter 4The Building Blocks: Data Types, Literals, Variables, and Constants

Image

“One man’s constant is another man’s variable.”

Alan Perlis

4.1 Data Types

A program can do many things, including perform calculations, sort names, prepare phone lists, display images, play chess, ad infinitum. To do anything, however, the program works with the data that is given to it. Data types specify what kind of data, such as numbers and characters, can be stored and manipulated within a program. PHP supports a number of fundamental basic data types, such as integers, floats, and strings. Basic data types are the simplest building ...

Get PHP and MySQL by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.