Cameron Garnett/Testpage5
Contents
Super Quick PHP Tutorial
Introduction | Basic Syntax | Sending Data to the Browser | Comments | Variables | Strings | Functions | Quotes | Debugging | Form
Learning ObjectivesBy the end of this page you will know how to print data on the screen and the different ways that you can do it. |
Sending data to the Browser
In PHP there are two ways you can get what you want to show up on the screen.
first of all is the ECHO command.
In this next example I will add some variables into the sentence to show you how you would output a variables within a string with the echo command.
ACTIVITYwrite the above block of code into notepad ++ and get yourself familiar with using the echo command. |
The second way to output to the browser is the print command. It works the same way as the echo command. For example
ACTIVITYwrite the above block of code into notepad ++ and get yourself familiar with using the print command. |
Be careful so that you don't type "." instead of ";" at the end of a line.
Example<?php |
The output is "axbc", because of the dot on the first line.