PHP Question

Make a function to print something depending the parameter

I want to create a function that the parameter takes the values 'on' and 'off'

public function test(on || off) {
if isset[test(on);] -> {echo "test";}
if isset[test(off);] -> {echo "test"; echo "<br>"; echo "great";}
}


the end result I'd like to be:

public function test(on || off) {
if isset[test(on);] -> {function1();}
if isset[test(off);] -> {function1(); echo "<br>"; function2();}
}

Answer
define("ON",1);
define("OFF",0);
//from here you can use ON or OFF in your program

function test($param = OFF) { //default state if not supplied will be OFF
if($param == ON){
    function1();
}else{
    function1();
    echo "<br>";
    function2();
}
}

test(ON); //will callfunction 1
test(OFF); // will call function1 echo br call function 2