O'Reilly logo

PHP 5 Recipes: A Problem-Solution Approach by Jon Stephens, Frank M. Kromann, Nathan A. Good, Lee Babin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 10Working with Variables

Variables are an important part of any programming language, and that goes for PHP too. Variables are blocks of memory associated with a name and a data type, and variables contain data to be used in calculations, program flow, presentation, and so on.

PHP is a loosely typed language where variables can be used without declarations and where they can change type from line to line, in some cases without losing the content. This makes programming much easier than in more strictly typed languages, but it can also make it more difficult to debug the code.

All variable names in PHP start with a dollar ($) sign. This makes it easy for the scripting engine, as well as the reader, to identify variables anywhere in the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required