CASE is a function used by the function switch. Switch is commonly used when having alot of if and else commands insted of if and else. It does the same thing.
IF are more faster when doing small if and else command but time consuming when you have around 20 of them. So PHP made a function which allowed you to do this more cleanly and faster processing.
Switch tells the computer to check the variable for cases. Or if non found it does what default is set to.
Example:
PHP:
$happy = 'HELLO';
switch $happy {
case 'Hi':
// Do something
break;
case 'HELLO':
// Do something
break;
}
Now for functions.
Function pretty much sets a function. Tells the browser to set a class function so when called it processed it and returns a value (Wether true or false)
Example
PHP:
function bob() {
print 'hello';
}
bob();
// Will print hello
?>
You can also transfer variables through a function like this
PHP:
function bob($bob) {
print '$bob';
}
bob('hello');
// Will print hello
?>
This will call the function bob. Passing the value of hello to the variable bob. It will than print hello.