the contents should be:
1 => array(
"page_file" => '/dir/welcome.php',
"page_title" => 'title page',
"page_sidebar" => '/dir/path/sidebar.php'
),
ect...
You can list the $content to build urls...
foreach( $content AS $key=>$value)
{
printf('<a href="index.php?id=%d">%s</a>', $key , $value["page_title"] );
}
How to retrieve the content by $_GET["id"]
$id=isset( $_GET["id"]) ? $_GET["id"] : 1; // set a default page...
Get all data from $content array based on the $id:
if(array_key_exists($id , $content))
$p=$content[$id];
else
die("page does not exist");
include( $p["page_file"] );
echo $p["page_title"];
Lets read a little:
array()
array_key_exists()
die()
isset()
printf()