Build and then call a function
<?php
function helloworld (){
echo "Hello World!<br />";
}
helloworld();
function saysomething ($something){
echo $something . "<br />";
}
Saysomething ("Hello World!"); //This would output "Hello World!"
function addvalues ($firstvalue, $secondvalue){
return $firstvalue + $secondvalue;
}
$newvalue = addvalues (1,3);
echo $newvalue;
?>
Related examples in the same category