Thanks for the tips. It will take me a while to try those out.
@ John_Bettong - One project I’m working on is a series of articles about various biology topics. Each page features a series index that features links to every article in that series (e.g. Mammal Series), along with links to other series (e.g. Plants, Reptiles). To make it work, I first derive some values from my database, particularly $PopTax (e.g. Life, Animal, Mammal, Plant) and $MyTopic (e.g. Homes, Morphology, Ecology).
Then I include a file that puts together a fairly elaborate project index based on these values. So if I visit MySite/topics/animal-behavior, it would display links to every articles (about a dozen) in the Animals series, links to the home pages of other series, and a list of all behavior articles (animals, mammals, fish, etc.).
It’s a big pile of code, but I pasted the whole thing below, just to give you an idea of what I’m working with. Hopefully, I can condense the code some day after I learn a few more PHP tricks. 
Thanks.
switch($PopTax)
{
// PLANTS
case 'Plant':
// INNER SWITCH
switch($MyTopic)
{
case 'Introduction':
case 'Homes':
case 'People':
$Title2 = $Title;
break;
default:
$Title2 = str_replace(''.$PopTax.' ', '', $Title);
break;
}
// END INNER SWITCH
break;
case 'Flowering Plant':
case 'Conifer':
// INNER SWITCH
switch($MyTopic)
{
case 'Introduction':
case 'Homes':
case 'People':
$Title2 = $Title;
break;
default:
$Title2 = str_replace(''.$PopTax.' ', '', $Title);
break;
}
// END INNER SWITCH
break;
// ANIMALS
case 'Animal':
case 'Vertebrate':
case 'Human':
// INNER SWITCH
switch($MyTopic)
{
case 'Introduction':
case 'Homes':
case 'People':
$Title2 = $Title;
break;
default:
$Title2 = str_replace(''.$PopTax.' ', '', $Title);
break;
}
// END INNER SWITCH
break;
case 'Mammal':
case 'Bird':
case 'Reptile':
case 'Amphibian':
case 'fish':
case 'Arthropod':
case 'Insect':
case 'Mollusk':
// INNER SWITCH
switch($MyTopic)
{
case 'Introduction':
case 'Homes':
case 'People':
$Title2 = $Title;
break;
default:
$Title2 = str_replace(''.$PopTax.' ', '', $Title);
break;
}
// END INNER SWITCH
break;
default:
break;
}
switch($PopTax)
{
case 'Life':
$SeriesIndex = '1. <a href="/introduction" title="Life 101">Life 101</a><br>
2. <a href="/topics/classification" title="Classification">Classification</a><br>
3. <a href="/topics/homes" title="Homes">Homes</a><br>
4. <a href="/topics/morphology" title="Morphology">Morphology</a><br>
5. <a href="/topics/physiology" title="Physiology">Physiology</a><br>
6. <a href="/topics/movement" title="Movement">Movement</a><br>
7. <a href="/topics/nutrition" title="Nutrition">Nutrition</a><br>
8. <a href="/topics/behavior" title="Behavior">Behavior</a><br>
9. <a href="/topics/reproduction" title="Reproduction">Reproduction</a><br>
10. <a href="/topics/ecology" title="Ecology">Ecology</a><br>
11. <a href="/topics/evolution" title="Evolution">Evolution</a><br>
12. <a href="/topics/people" title="People">People</a>';
$SeriesIndex = str_replace('<a href="/'.$Title.'" title="Life 101">Life 101</a>', '<span style="padding: 0 5px; background: #f00; color: #ff0;"><b>Life 101</b></span>', $SeriesIndex);
$SeriesIndex = str_replace('<a href="/topics/'.$MyURL.'" title="'.$Title.'">'.$Title.'</a>', '<span style="padding: 0 5px; background: #f00; color: #ff0;"><b>'.$Title.'</b></span>', $SeriesIndex);
break;
// PLANTS
case 'Plant':
$SeriesIndex = '1. <a href="/topics/'.$PopTaxL.'" title="'.$PopTaxa.' 101">'.$PopTaxa.' 101</a><br>
2. <a href="/topics/'.$PopTaxL.'-classification" title="'.$PopTax.' Classification">Classification</a><br>
3. <a href="/topics/'.$PopTaxL.'-homes" title="'.$PopTax.' Homes">'.$PopTax.' Homes</a><br>
4. <a href="/topics/'.$PopTaxL.'-morphology" title="'.$PopTax.' Morphology">Morphology</a><br>
5. <a href="/topics/'.$PopTaxL.'-physiology" title="'.$PopTax.' Physiology">Physiology</a><br>
6. <a href="/topics/'.$PopTaxL.'-movement" title="'.$PopTax.' Movement">Movement</a><br>
7. <a href="/topics/'.$PopTaxL.'-nutrition" title="'.$PopTax.' Nutrition">Nutrition</a><br>
8. <a href="/topics/'.$PopTaxL.'-behavior" title="'.$PopTax.' Behavior">Behavior</a><br>
9. <a href="/topics/'.$PopTaxL.'-reproduction" title="'.$PopTax.' Reproduction">Reproduction</a><br>
10. <a href="/topics/'.$PopTaxL.'-ecology" title="'.$PopTax.' Ecology">Ecology</a><br>
11. <a href="/topics/'.$PopTaxL.'-evolution" title="'.$PopTax.' Evolution">Evolution</a><br>
12. <a href="/topics/'.$PopTaxaL.'-and-people" title="'.$PopTaxa.' and People">'.$PopTaxa.' & People</a>';
$SeriesIndex = str_replace('<a href="/topics/'.$MyURL.'" title="'.$Title.'">'.$Title2.'</a>', '<span style="padding: 0 5px; background: #f00; color: #ff0;"><b>'.$Title2.'</b></span>', $SeriesIndex);
$SeriesIndex = str_replace('<a href="/topics/'.$MyURL.'" title="'.$Title.'">'.$PopTaxa.' & People</a>', '<span style="padding: 0 5px; background: #f00; color: #ff0;"><b>'.$PopTaxa.' & People</b></span>', $SeriesIndex);
break;
case 'Flowering Plant':
case 'Conifer':
$PopTaxL = str_replace(' ', '-', $PopTax);
$PopTaxaL = str_replace(' ', '-', $PopTaxa);
$SeriesIndex = '1. <a href="/topics/'.$PopTaxL.'" title="'.$PopTaxa.' 101">'.$PopTaxa.' 101</a><br>
2. <a href="/topics/'.$PopTaxL.'-classification" title="'.$PopTax.' Classification">Classification</a><br>
3. <a href="/topics/'.$PopTaxL.'-homes" title="'.$PopTax.' Homes">'.$PopTax.' Homes</a><br>
4. <a href="/topics/'.$PopTaxL.'-morphology" title="'.$PopTax.' Morphology">Morphology</a><br>
5. <a href="/topics/'.$PopTaxL.'-physiology" title="'.$PopTax.' Physiology">Physiology</a><br>
6. <a href="/topics/'.$PopTaxL.'-nutrition" title="'.$PopTax.' Nutrition">Nutrition</a><br>
7. <a href="/topics/'.$PopTaxL.'-reproduction" title="'.$PopTax.' Reproduction">Reproduction</a><br>
8. <a href="/topics/'.$PopTaxL.'-ecology" title="'.$PopTax.' Ecology">Ecology</a><br>
9. <a href="/topics/'.$PopTaxL.'-evolution" title="'.$PopTax.' Evolution">Evolution</a><br>
10. <a href="/topics/'.$PopTaxL.'-and-people" title="'.$PopTaxa.' and People">'.$PopTaxa.' & People</a>';
$SeriesIndex = str_replace('<a href="/topics/'.$MyURL.'" title="'.$Title.'">'.$Title2.'</a>', '<span style="padding: 0 5px; background: #f00; color: #ff0;"><b>'.$Title2.'</b></span>', $SeriesIndex);
$SeriesIndex = str_replace('<a href="/topics/'.$MyURL.'" title="'.$Title.'">'.$PopTaxa.' & People</a>', '<span style="padding: 0 5px; background: #f00; color: #ff0;"><b>'.$PopTaxa.' & People</b></span>', $SeriesIndex);
break;
// ANIMALS
case 'Animal':
case 'Vertebrate':
case 'Human':
$SeriesIndex = '1. <a href="/topics/'.$PopTaxL.'" title="'.$PopTaxa.' 101">'.$PopTaxa.' 101</a><br>
2. <a href="/topics/'.$PopTaxL.'-classification" title="'.$PopTax.' Classification">Classification</a><br>
3. <a href="/topics/'.$PopTaxL.'-homes" title="'.$PopTax.' Homes">'.$PopTax.' Homes</a><br>
4. <a href="/topics/'.$PopTaxL.'-morphology" title="'.$PopTax.' Morphology">Morphology</a><br>
5. <a href="/topics/'.$PopTaxL.'-physiology" title="'.$PopTax.' Physiology">Physiology</a><br>
6. <a href="/topics/'.$PopTaxL.'-movement" title="'.$PopTax.' Movement">Movement</a><br>
7. <a href="/topics/'.$PopTaxL.'-nutrition" title="'.$PopTax.' Nutrition">Nutrition</a><br>
8. <a href="/topics/'.$PopTaxL.'-behavior" title="'.$PopTax.' Behavior">Behavior</a><br>
9. <a href="/topics/'.$PopTaxL.'-reproduction" title="'.$PopTax.' Reproduction">Reproduction</a><br>
10. <a href="/topics/'.$PopTaxL.'-ecology" title="'.$PopTax.' Ecology">Ecology</a><br>
11. <a href="/topics/'.$PopTaxL.'-evolution" title="'.$PopTax.' Evolution">Evolution</a><br>
12. <a href="/topics/'.$PopTaxaL.'-and-people" title="'.$PopTaxa.' and People">'.$PopTaxa.' & People</a>';
$SeriesIndex = str_replace('<a href="/topics/'.$MyURL.'" title="'.$Title.'">'.$Title2.'</a>', '<span style="padding: 0 5px; background: #f00; color: #ff0;"><b>'.$Title2.'</b></span>', $SeriesIndex);
$SeriesIndex = str_replace('<a href="/topics/'.$MyURL.'" title="'.$Title.'">'.$PopTaxa.' & People</a>', '<span style="padding: 0 5px; background: #f00; color: #ff0;"><b>'.$PopTaxa.' & People</b></span>', $SeriesIndex);
break;
case 'Mammal':
case 'Bird':
case 'Reptile':
case 'Amphibian':
case 'fish':
case 'Arthropod':
case 'Insect':
case 'Mollusk':
$SeriesIndex = '1. <a href="/topics/'.$PopTaxL.'" title="'.$PopTaxa.' 101">'.$PopTaxa.' 101</a><br>
2. <a href="/topics/'.$PopTaxL.'-classification" title="'.$PopTax.' Classification">Classification</a><br>
3. <a href="/topics/'.$PopTaxL.'-homes" title="'.$PopTax.' Homes">'.$PopTax.' Homes</a><br>
4. <a href="/topics/'.$PopTaxL.'-morphology" title="'.$PopTax.' Morphology">Morphology</a><br>
5. <a href="/topics/'.$PopTaxL.'-physiology" title="'.$PopTax.' Physiology">Physiology</a><br>
6. <a href="/topics/'.$PopTaxL.'-movement" title="'.$PopTax.' Locomotion">Locomotion</a><br>
7. <a href="/topics/'.$PopTaxL.'-nutrition" title="'.$PopTax.' Diets">Diets</a><br>
8. <a href="/topics/'.$PopTaxL.'-behavior" title="'.$PopTax.' Behavior">Behavior</a><br>
9. <a href="/topics/'.$PopTaxL.'-reproduction" title="'.$PopTax.' Reproduction">Reproduction</a><br>
10. <a href="/topics/'.$PopTaxL.'-ecology" title="'.$PopTax.' Ecology">Ecology</a><br>
11. <a href="/topics/'.$PopTaxL.'-evolution" title="'.$PopTax.' Evolution">Evolution</a><br>
12. <a href="/topics/'.$PopTaxaL.'-and-people" title="'.$PopTaxa.' and People">'.$PopTaxa.' & People</a>';
$SeriesIndex = str_replace('<a href="/topics/'.$MyURL.'" title="'.$Title.'">'.$Title2.'</a>', '<span style="padding: 0 5px; background: #f00; color: #ff0;"><b>'.$Title2.'</b></span>', $SeriesIndex);
$SeriesIndex = str_replace('<a href="/topics/'.$MyURL.'" title="'.$Title.'">'.$PopTaxa.' & People</a>', '<span style="padding: 0 5px; background: #f00; color: #ff0;"><b>'.$PopTaxa.' & People</b></span>', $SeriesIndex);
break;
case 'Invertebrate':
$SeriesIndex = '<span style="padding: 0 5px; background: #f00; color: #ff0;"><b>Invertebrates</b></span>';
break;
default:
break;
}
?>
<?php
switch(PHP_OS)
{
case 'Linux':
break;
default:
// INNER SWITCH
switch ($ShadowPage)
{
case 'ShadowPage':
echo '<div style="background: #90c; color: #fff;; font-size: 75%; text-align: center;">inc/D/Shared/Body/Content/Series/GZ.php</div>';
break;
default:
break;
}
// END INNER SWITCH
break;
}
?>
<div style="padding: 5px; background: #fff; border: 1px dashed #000;">
<div id="IntroSeries" style="margin-bottom: 5px; background: #000; color: #fff; font-weight: 800; text-align: center;">Introductory Series</div>
<?php
echo $SeriesIndex;
switch($PopTax)
{
case 'Human':
$HumanCode = '';
break;
default:
$HumanCode = ' background: #ff0; border: 1px solid #f00;';
break;
}
$Switch = '<div style="margin: 5px auto; padding: 2px 5px; background: #cff; border-top: 1px dotted #000;">
<em>Switch to...</em>
<a href="/introduction" title="Life">LIFE</a><br>
<div style="padding: 5px; background: #fcc;">
<a href="/topics/animal" title="Animals">Animals</a> >
I. <a href="/topics/vertebrate" title="Vertebrates">Vertebrates</a> >
<a href="/topics/mammal" title="Mammals">Mammals</a> >
<a href="/topics/human" title="Humans">Humans</a> |
<a href="/topics/bird" title="Birds">Birds</a> |
<a href="/topics/reptile" title="Reptiles">Reptiles</a> |
<a href="/topics/amphibian" title="Amphibians">Amphibians</a> |
<a href="/topics/fish" title="Fish">Fish</a>
II. <a href="/topics/invertebrate" title="Invertebrates">Invertebrates</a> >
<a href="/topics/arthropod" title="Arthropods">Arthropods</a> |
<a href="/topics/insect" title="Insects">Insects</a> |
<a href="/topics/mollusk" title="Mollusks">Mollusks</a>
</div>
<div style="padding: 5px; background: #cfc;">
<a href="/topics/plant" title="Plants">Plants</a> >
<a href="/topics/flowering-plant" title="Flowering Plants">Flowering Plants</a> |
<a href="/topics/conifer" title="Conifers">Conifers</a>
</div>
<div style="padding: 5px; background: #fff;">
<a href="/topics/fungus" title="Fungi">Fungi</a>
</div>
</div>';
switch($PopTax)
{
case 'Life':
$Switch = str_replace('<a href="/introduction" title="Life">LIFE</a>', '<span style="padding: 0 5px; background: #f00; color: #ff0;"><b>Life</b></span>', $Switch);
break;
case 'Flowering Plant':
$Switch = str_replace('<a href="/topics/flowering-plant" title="Flowering Plants">Flowering Plants</a>', '<span style="padding: 0 5px; background: #f00; color: #ff0;"><b>Flowering Plants</b></span>', $Switch);
break;
default:
$Switch = str_replace('<a href="/topics/'.$PopTaxL.'" title="'.$PopTaxa.'">'.$PopTaxa.'</a>', '<span style="padding: 0 5px; background: #f00; color: #ff0;"><b>'.$PopTaxa.'</b></span>', $Switch);
break;
}
echo $Switch;
?>
</div>
<?php
$MyTopicL = strtolower($MyTopic);
switch($MyTopic)
{
case 'People':
echo '<div style="margin-top: 5px; padding: 5px; background: #fff; border: 1px dashed #000;">
<div id="IntroSeries" style="margin-bottom: 5px; background: #009; color: #fff; font-weight: 800; text-align: center;">'.$MyTopic.' Channel</div>
• <a href="/topics/plants-and-people" title="Plants and People">Plants</a><br>
> <a href="/topics/flowering-plants-and-people" title="Flowering Plants and People">Flowering Plants</a><br>
> <a href="/topics/conifers-and-people" title="Conifers and People">Conifers</a><br>
• <a href="/topics/animals-and-people" title="Animals and People">Animals</a><br>
> <a href="/topics/mammals-and-people" title="Mammals and People">Mammals</a><br>
>> <a href="/topics/humans-and-people" title="Humans and People">Humans</a><br>
> <a href="/topics/birds-and-people" title="Birds and People">Birds</a><br>
> <a href="/topics/reptiles-and-people" title="Reptiles and People">Reptiles</a><br>
> <a href="/topics/amphibians-and-people" title="Amphibians and People">Amphibians</a><br>
> <a href="/topics/fish-and-people" title="Fish and People">Fish</a><br>
> <a href="
/topics/invertebrate#'.$MyTopic.'" title="Invertebrates and People">Invertebrates</a><br>
> <a href="/topics/arthropods-and-people" title="Arthropod and People">Arthropods</a><br>
> <a href="/topics/insects-and-people" title="Insect and People">Insects</a>
</div>';
break;
default:
// INNER SWITCH
switch($MyTopic)
{
case 'Movement':
// INNER SWITCH 2
switch($MyTopic)
{
case 'Flowering Plant':
$FloweringPlants = '';
break;
case 'Conifer':
$Conifers = '';
break;
case 'Fungi':
$Fungi = '';
break;
default:
break;
}
// END INNER SWITCH 2
break;
case 'Behavior':
// INNER SWITCH 2
switch($MyTopic)
{
case 'Flowering Plant':
$FloweringPlants = '';
break;
case 'Conifer':
$Conifers = '';
break;
case 'Fungi':
$Fungi = '';
break;
default:
break;
}
// END INNER SWITCH 2
break;
default:
$FloweringPlants = '> <a href="/topics/flowering-plant-'.$MyTopicL.'" title="Flowering Plant '.$MyTopic.'">Flowering Plants</a><br>';
$Conifers = '> <a href="/topics/conifer-'.$MyTopicL.'" title="Conifer '.$MyTopic.'">Conifers</a><br>';
$Fungi = '• <a href="/topics/fungi-'.$MyTopicL.'" title="Fungis '.$MyTopic.'">Fungi</a><br>';
break;
}
// END INNER SWITCH
echo '<div style="margin-top: 5px; padding: 5px; background: #fff; border: 1px dashed #000;">
<div id="IntroSeries" style="margin-bottom: 5px; background: #009; color: #fff; font-weight: 800; text-align: center;">'.$MyTopic.' Channel</div>
• <a href="/topics/plant-'.$MyTopicL.'" title="Plant '.$MyTopic.'">Plants</a><br>
'.$FloweringPlants.'
'.$Conifers.'
'.$Fungi.'
• <a href="/topics/animal-'.$MyTopicL.'" title="Animal '.$MyTopic.'">Animals</a><br>
> <a href="/topics/mammal-'.$MyTopicL.'" title="Mammal '.$MyTopic.'">Mammals</a><br>
>> <a href="/topics/human-'.$MyTopicL.'" title="Human '.$MyTopic.'">Humans</a><br>
> <a href="/topics/bird-'.$MyTopicL.'" title="Bird '.$MyTopic.'">Birds</a><br>
> <a href="/topics/reptile-'.$MyTopicL.'" title="Reptile '.$MyTopic.'">Reptiles</a><br>
> <a href="/topics/amphibian-'.$MyTopicL.'" title="Amphibian '.$MyTopic.'">Amphibians</a><br>
> <a href="/topics/fish-'.$MyTopicL.'" title="Fish '.$MyTopic.'">Fish</a><br>
> <a href="
/topics/invertebrate#'.$MyTopic.'" title="Invertebrate '.$MyTopic.'">Invertebrates</a><br>
> <a href="/topics/arthropod-'.$MyTopicL.'" title="Arthropod '.$MyTopic.'">Arthropods</a><br>
> <a href="/topics/insect-'.$MyTopicL.'" title="Insect '.$MyTopic.'">Insects</a>
</div>';
break;
}