I have a PHP switch that holds brief articles about a certain topic for the 50 U.S. states. For example, the content under ID 'ak' displays on the Alaska page...
<?php
switch($ID)
{
case 'ak':
?>
Text
<?php
break;
case 'ca':
?>
Text
<?php
break;
default:
break;
}
I designed it so that I can see the text and work on it in "plain view."
It works fine, but I just wondered if there's a simple way to display EVERYTHING in the switch on a single page. It could easily be done if the data was stored in a database, of course, but I don't know how to do it with a simple PHP switch.
I can do it manually, like this:
$ID = 'az';
echo '<h1>Arizona</h1>';
require($BaseINC."../../inc/view.php");
require($BaseINC."../../inc/eco/plants/flower.php");
$ID = 'wy';
echo '<h1>Wyoming</h1>';
require($BaseINC."../../inc/view.php");
require($BaseINC."../../inc/eco/plants/flower.php");
But I just wondered if there's an easier way.
One catch: I don't want to "kill" the ID's. Each ID may influence some of content displayed beneath that ID. So I guess a better way would be to give the display file some sort of universal ID that displays everything.
Note: Just to explain why I'm doing this, I was using Sigil to create epubs, but discovered I could manage my projects better using PHP, so I now want to create epubs in Dreamweaver, then import them into Sigil. I'm basically trying to create a simple test page.