PHP Tutorial 4: Variables & Strings

The concept of a variable is not too difficult to understand, and if you have any experience with basic algebra or advanced mathematics, you have already been introduced to variables. They work very much the same way in computer programming. A variable can be thought of as any entity that has the ability to take on different values.

Two terms you will often hear in relation to technology are static and dynamic. Static is anything that doesn't change. As with most rules, there are exceptions, but you can normally think of static as being something that stays consistent, either unto itself or across a population. Dynamic is anything that is likely to change, usually based on a given condition. All of your PHP code will be static, and variables, while normally dynamic, can be static in some cases.

Without variables, PHP would have very little use. Back in the 1990s, during the early days of the modern internet, most websites were static. Information had to be manually updated by the web master. This involved editing the HTML or text files that made up a web page and linking them together. It was very difficult to make massive changes to the layout or structure of your website. While tools such as SSI, or server-side includes, made some modification possible, most pages were very static and not updated as frequently as many sites are today.

Variables make it possible to include content on your website that has the ability to change without the web master having to make constant changes behind the scenes. Examples where variables can really come in handy include the ability to offer user accounts, which lets you customize content based on the person browsing the site, and the ability to develop templates that all pages of the site can use to display content in a uniform fashion.
123 >
By Chris - September 9, 2009 | Read Comments
Recommended Reading:
Comments (Viewing 0-0 of 0)
There are currently no comments.
You must be logged in to post comments. Click here to sign in.

New Modules
Sign In With Facebook
Sign In With Mowia

about mowia
Mowia is a collaborative content management website. You can share your thoughts, experiences, and knowledge with others, and we'll organize that information so anyone can read and learn from it. Live, explore, and share your knowledge with others.
mowia.com  |  myMowia  |  Help Center  |  Privacy  |  Terms

Notice: Mowia is an independent organization that does not provide offical support services for any of the products referenced on the forum nor does it represent any of the companies whose products are referenced. All product copyrights, patents, and trademarks belong to their respective owners.

Valid CSS!
© 2009 mowia.com