>>441
まじめに質問しているのなら、あらかじめ謝っておく

こんなの
switch ($state) {
case 'state_a':
a();
break;
case 'state_b':
b();
break;
}