From the course: PHP for Web Designers
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Using variables to store information - PHP Tutorial
From the course: PHP for Web Designers
Using variables to store information
One of the most important features of the programming language like PHP is the use of variables to store values that might change or aren't known in advance. If you've done any work with Javascript much of this will be familiar to you but there are some important differences. Even if you don't know any other programming language You use variables all the time, without even realizing it. For example, what's your name? My name's David, but my producer's name is Scott. The word name is a real-life variable. Name always remains the same, but its value changes. Let's look at some other real-life examples of variables. What day is it? What's the distance? Which city are you going to? To convert these real-life variables into PHP variables, just stick a dollar sign at the beginning of the word. A PHP script can then change the value of the variable, depending on who's logged into a website, name might become David, Scott, or Linda. PHP is capable of working out the current day or date. So…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
How PHP makes web pages dynamic5m 23s
-
How to use PHP in a web page6m 43s
-
Using variables to store information2m 52s
-
Storing numbers and text in variables5m 18s
-
Displaying the values of number and text variables8m 9s
-
Using functions to manipulate values4m 36s
-
Adding comments to PHP scripts4m 46s
-
-
-
-
-
-
-
-