I'm trying to code a site similar to the coding on the bottom. I need help though I'm not sure if functions for php can work this way. I want to be able to use the function greeting in many different if else statements. How can i do this without having to plug the entire code in to every if else statement. Thanks
function greeting(){
if($greetings == hello){
echo "Hello";
}else{
echo "goodbye";
}
}
if($occupancy > 0){
function greeting()
}else{
echo "Nobody is home";
}