<?php 
<?php

// USING _HTTP_ROOT
   $req_uri        = preg_replace('%^'.preg_quote(_HTTP_ROOT, '%').'%i', '', $_SERVER['REQUEST_URI']);
   $url_arr        = parse_url($req_uri);
   $url_path_arr   = explode('/', trim($url_arr['path'], '/'));
   $controller     = $url_path_arr[0];


// WITHOUT REQUEST_URI
    $url_arr        = parse_url($_SERVER['REQUEST_URI']);
    $url_path_arr   = explode('/', trim($url_arr['path'], '/'));
    $controller     = $url_path_arr[0];


?>
 ?>