class UrlParse
{
//private $uri;
private $urlApp = NULL;
private $urlAction = NULL;
private $urlQuery = NULL;
function __construct()
{
//$this->uri = $_SERVER['REQUEST_URI'];
$app = explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
$act = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
$this->urlApp = $app[1];
$this->urlAction = $app[2];
$this->urlQuery = $act;
}
public function getUrlApp()
{
return $this->urlApp;
}
public function getUrlAction()
{
return $this->urlAction;
}
public function getUrlQuery()
{
return $this->urlQuery;
}
}
$b = new UrlParse();
echo 'App = ', $b->getUrlApp(), '<br><br>'; //
echo 'Action = ', $b->getUrlAction(), '<br><br>';
echo 'Query = ', $b->getUrlQuery(), '<br><br>';
Вот он: