Archive for January, 2008

Understanding when to use constants

If you know the value of something won’t change during the script, use a constant.
Using a constant allows you to use a descriptive name, making the
script clearer. For example, PRODUCT_COST is much clearer than 20.50. Read the rest of this entry »

Leave a Comment

Creating constants

Constants are set by using the define statement. The general format is as
follows: Read the rest of this entry »

Leave a Comment

Removing Variables

You can also remove information from a variable. You can use the following
statement: Read the rest of this entry »

Leave a Comment

Using Variable Variables

PHP allows you to use dynamic variable names, called variable variables. You
can name a variable by using the value stored in another variable. That is, one
variable contains the name of another variable. For example, suppose you want
to construct a variable named $city with the value Los Angeles. You can use
the following statement: Read the rest of this entry »

Leave a Comment