Sunday, April 11, 2010

Workshop 2

Variables

The Workshop 2 introduces some variables to our PHP script. Variables in PHP begin with the $ symbol. PHP uses arrays and variables to store different values. Variables begin with a $ followed by characters, digits, and underscores. Variable names are case sensitive and are assigned with the '=' operator. Variables are incredibly useful. For example, you may need to keep track of information submitted via a web form or perform calculations on data and store the results.

Here's a simple example:

Test Code

1 comment:

  1. This article clearly describes that in PHP programming, a variable is a facility for storing data. The current value of the variable is the data actually stored in the variable. Depending on the programming language in question, the data stored in the variable can be intentionally altered during the program run, thus causing its value to change, or vary, hence the name. The variable can be referenced by identifiers. In contemporary programming languages, even non-identical identifiers can refer to the same variable.
    This is a very useful workshop.

    ReplyDelete