Eli Tutorials
Part 1: Introduction to PHP Programming
Part 3: Comments and INCLUDE in PHP Programming
Part 4: Variables in Print in PHP Programming
Strings, integers, and arrays. Strings are words, and are declared by $variable = "Hello World";. Integers are numbers, and are declared by $variable = 42;, using no quotation marks. Arrays are lists of items and are created by $variable = array();.
Variables are case sensitive, so the variables $variable, $VARIABLE, and $Variable are all different variables. It is useful to keep all variables in the same style - for example, naming all of your variables with lowercase letters throughout your code. Variable names must begin with a letter or an underscore.
\n is the command in PHP to start a new line, however it will not work when printed within quotation marks, as the browser will read it as HTML text. the <br> tag is the HTML equivalent of the \n newline character in PHP, and will place text on two lines.
The link above is the sample code created with Eli's demonstration of variables and print in PHP. It shows several lines are really just variables that have been printed with various HTML formatting, and also demonstrates the importance of using the <br> tag in quotation marks to print text on two lines.