Changes

An Introduction to PHP Variables

1 byte added, 17:27, 25 May 2007
Checking Whether a Variable is Set
== Checking Whether a Variable is Set ==
When working with variables it is often necessary to ascertain whether a variable actually has a value associated with it or not at any particular point in a script. A mechanism is provided with PHP provide this ability through the ''isset()'' function. To test whether a variable has a value set simply call the ''isset()'' function passing through the name of the variable as an argument (see [[PHP Functions]] for details of passing through arguments to functions. The following code example tests to see if a variable has a value or not and displays a message accordingly:
<pre>