In order to become familiar with PHP programming structures and commands, we will build various PHP pages. The following assignments will explain PHP commands, provide a link to a working sample, and detail the working sample's PHP code.
<html>The same can be achieved with the echo command, but we will use print() in this class. Also, be careful printing certain characters like quotation marks ("). Use the backslash character (\) to escape quotations, like this: print("She said, \"I hate smelly feet.\""); The backslash character escapes special characters that cause PHP and MySQL to generate errors. Finally, you can combine items to print by using the period (.). The period is used to concatinate two separate string items. Concatinate is just a fancy word for put together. Here is an example: print("My best student is ". $student); In the above example $student is a variable that holds a name. Which brings me to variables. |
In JavaScript, we used document.write. For concatination we used the + symbol.