Site Cloner PHP Script
Bargain Hunter PHP Script
Job Hunter PHP Script
Site Login and Access Control PHP Script

Passing Variable Into PHP Functions

When you pass a variable($myvar) into a PHP function, it can be used within the function. The example below shows how to pass a variable into a function and how to output that variable.

$var=”Hello”;
//To call a function, you simply use the function name and put the variable you want to pass in parenthesees
my_function($var);
function my_function($my_new_var) {
    echo $my_new_var; //Outputs Hello
    }