I just want to checking if this kind of routing is good or bad?I implement the routing of my web appl to something like this.All page will be pointing to the index.phpin index.php I have this code$url = array_values(array_filter( explode( '/', strtolower($_SERVER[REQUEST_URI]) ) ) ); switch( $url[0] ) {    case admin    : {        if( !$this->us->isAdmin ) {            $this->GoToLoginPage();        }        array_shift( $uri );        $department = new Admin( $uri );    } break;    case article  : {        if( count( $uri ) == 2 ) {            displayArticle( $uri[1] );        }        else {            displayError();        }    } break;    default : {        displayIndex();    } break;}I just want to know is there any pro and con of doing something like this.
Is my routing good or bad? in PHP
php
Separate your logic and site specific functionality like this:function Router{    $url = array_values(array_filter(explode('/', strtolower($_SERVER[REQUEST_URI]))));    switch($url[0]){        case admin: $this->Admin($url);            break;        case article: $this->Article($url);            break;        default: displayIndex();    }}function Admin($uri){    if( !$this->us->isAdmin ) {        $this->GoToLoginPage();    }    array_shift( $uri );    $department = new Admin( $uri );}function Article($uri){    if( count( $uri ) == 2 ) {        displayArticle( $uri[1] );    } else {        displayError();    }}It's much cleaner, and easier to update.