© Frank M. Kromann 2016

Frank M. Kromann, PHP and MySQL Recipes, 10.1007/978-1-4842-0605-8_10

10. Variables

Frank M. Kromann

(1)Trabuco Canyon, California, USA

Variables are used to store data temporarily in memory. Variables only exist as long as the PHP script is running. They are identified with a dollar sign followed by a name. The name of a variable can begin with a letter (a-z or A-Z) or an underscore. Any of the following characters can be a number, a letter, or any ASCII character from 127 to 255 (0x7f – 0xff). There is no restriction on the number of characters in the name. Variable names are case sensitive so $var, $Var, and $VAR will be three different variables.

PHP is a loosely typed language where variables can change type depending ...

Get PHP and MySQL Recipes: A Problem-Solution Approach, Second Edition 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.