This is to declare functions:
- PHP: Select all
function say($what) {
echo $what;
}
// and call it with
say("Hello");
// you can put anything in a function and set returns
function isTrue($b) {
if($b == true) { return true; } else { return false; }
}
//the following will output hi
if(isTrue(1)) { echo 'hi'; }
Hope that helps a bit.