Cameron Garnett/Testpage9

Super Quick PHP Tutorial
Introduction
 * Basic Syntax
 * Sending Data to the Browser
 * Comments
 * Variables
 * Strings
 * Functions
 * Quotes
 * Debugging
 * Form

Functions

 * A function is a block of statements that can be used repeatedly in a program.
 * A function name can start with a letter or underscore (not a number).
 * Give the function a name that reflects what the function does!

PHP has more than 1000 built-in functions. If you don't think that is enough then you can create your own. User Defined Functions To create a user defined function in PHP you need to start with the word function. In this first example I will create a function called displaystring. The first curly bracket indicates the start of the code and the second curly bracket indicates the end of the function. Very similar to javascript.

In the next example to get a function to return a sum use the return statement. The $x and the $y inside the brackets are parameters.