the code still has to be written but you are right, this might be easier to maintain
<?php
function getIncludes($aIncs)
{
foreach($aIncs as $inc)
{
include($inc);
}
}//getIncludes
$page1 = array("this.php", "that.php", "another.php");
$page2 = array("this.php", "that.php");
$page3 = array("that.php", "another.php");
if ($pageData["pageid"]=="1") getIncludes($page1);
?>
--untested but should work - might cause problems with globals so this might be better:
<?php
$page1 = array("this.php", "that.php", "another.php");
$page2 = array("this.php", "that.php");
$page3 = array("that.php", "another.php");
switch ($pageData["pageid"])
{
case "1": $aIncs = $page1; break;
case "2": $aIncs = $page2; break;
}
foreach($aIncs as $inc)
{
include($inc);
}
?>