Mailinglisten-Archive |
Selbstkorrektur:
<?php
$url = $_SERVER["PHP_SELF"];
$schemes = array(
"#/blog/(.*)$#" => "viewBlogEntry",
"#/feed/blog$#" => "viewFeedBlog",
"#/gallery/(.*)$#" => "viewGallery",
"#/(index.php)*$# => "showStartPage"
);
# und dann einzeln mit foreach durchloopen
$done = false;
foreach($schemes as $schema => $function) {
if(preg_match($schema, $url, $data)) {
$param = $data[1]; // soweit ich weiß.. evtl manual von preg_match konsultieren
$function($param);
$done = true;
break;
}
}
if(!$done)
show404();
?>
Gruß
Jonas
php::bar PHP Wiki - Listenarchive