Passing A Variable Into PHP Functions

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.

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