con switch innestati mi sembra + leggibile:
Codice PHP:
isset($_GET['cat']) ? $cat = $_GET['cat'] : $cat = '';
isset($_GET['sub']) ? $sub = $_GET['sub'] : $sub = '';
switch ($cat) {
case "a":
$macro = "Corsi Fashion Fondamentali";
switch($sub){
case "1":
$micro = "Fashion Make Up";
break;
case "2":
$micro = "Fashion Hair";
break;
default:
$micro = "";
}
break;
case "b":
switch($sub){
case "1":
$micro = "Fashion Make Up(2)";
break;
case "2":
$micro = "Fashion Hair-Styling";
break;
default:
$micro = "";
}
break;
}
echo $macro."-".$micro;