Using the same switch technique, you can call functions, and just write your functions into the same file, or into a separate include file, and just include the file before the switch...
<?
switch ($page):
case "home":
functionhome();
break;
case "links":
functionlinks();
break;
case "about":
functionabout();
break;
default:
functiondefault();
endswitch;
// The functions would need to be defined before the switch, but I put them after, as an edited afterthought.
function functionhome(){
echo "This is the Home Page";
}
function functionabout(){
echo "This is the about page";
}
// yadda yadda yadda for each section.
?>
Check the manuals for how to use functions (passing variables into and out of them, syntax, etc.)
To be honest with you, it is easier when you use separate includes, becuase you don't have to sift through hundreds of lines of code to find the "about" section to edit it for example... Just open the about.inc file, and edit it. (But that is a matter of preference I guess.)