How To Use function In PHP
How to use PHP functions Syntax: function functionname([arguments]) { } Functions can be placed anywhere in a page and will be available even if called above the actual function being created. The exception to this rule is if the function is only defined as part of a conditional statement, and is not available to be called until that conditional statement has been evaluated. Function names follow the same rules as other labels in PHP. A valid function name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. Example: declare of function without arguments <?php function greetMsg() { echo "Hello PHP!" ; } greetMsg(); // call the function ?> Note : Functions need not be defined before they are referenced, except when a function is conditionally defined as shown in the two examples below. Otherwise you will get: Fatal error : Call to undefined function gree...