shadowline
Functions - Arguments << Functions - Return Values >> Include
Sometimes you may want to call a function and have a value returned back to the main coding area. This is done using the return command.

Example :
<?php
function addit($first_number,$second_number){
    $total_sum = $first_number + $second_number;
    return $total_sum;
}

$first_number = "1";
$second_number ="2";
$total = addit($first_number,$second_number);
echo "$total";
?>

Result :
3

Leaving the return command out, the result would be blank.

In the above example, the variable $total calls the function entering two arguments. The function takes the numbers and finds the sum. The sum value is "returned" back to the calling variable $total.
Functions - Arguments << Functions - Return Values >> Include
shadow

Advertise in the banner along the top, Click here!

Valid XHTML 1.0 Transitional Valid CSS! Text Link Ads
shadow
shadow