Output in PHP would look no different from regular HTML if we couldn't make the content dynamic. Dynamic content means it can change based on certain conditions.  In PHP, we can use nicknames for things that can change.  Just like in math, these are called variables.

Variables are extremely important, because we can make decisions based on what the variables are equal to, or we can do math to store values into variables for later use, or we can just display the contents of a variable.

  • In PHP, variables always begin with a $ sign.  
  • Variable names are case sensitive
  • There are many types of variables. Today we will look at two kinds of variables: strings and values
  • Variables are assigned using a single "=" symbol

For more information about variables, visit the thread in the forums: http://www.hungrybeagle.com/index.php/forum/it11-12-php/7-php-variables

Things you should be able to do after today:

  • store a value in a variable
  • display the contents of a variable using the echo command
  • perform math calculations and store the contents into a variable
  • use variables to perform calculations

Login Form