What are Variables?

I l @ ve RuBoard

What are Variables ?

A variable is best thought of as a container for data. Once data has been stored in a variable (or, put differently, once a variable has been assigned a value), that data/variable can be altered , printed to the Web browser (when I say printed, it may help to think of it as sent, but it's the print statement that does the sending, so either term is appropriate), saved to a database, e-mailed, and so forth.

Variables are, by their nature, flexible: you can put data into a variable, retrieve that data from it (without affecting the value of the variable itself), put new data in, and you can continue this cycle as long as is necessary. But, variables in PHP are also temporary: they only exist ”that is, they only have a value ”while they are used within a script. Once you are in a new page, those variables cease to exist, unless you pass them along to the new page, which I'll discuss in the next chapter (HTML Forms and PHP).

I l @ ve RuBoard


PHP for the World Wide Web (Visual QuickStart Guide)
PHP for the World Wide Web (Visual QuickStart Guide)
ISBN: 0201727870
EAN: 2147483647
Year: 2001
Pages: 116
Authors: Larry Ullman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net