$myVar = 'blah'; function fooBar() { echo('foobar'); } if($myVar == 'blah') fooBar(); else echo('error!');