DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Pretty Urls
If url is 'index.php/hello' then $request will be 'hello'
$request = $_SERVER['PATH_INFO'];
if (isset($request[0]) && ($request[0] == '/')) {
$request = substr($request, 1);
}






Comments
p c replied on Tue, 2007/02/20 - 12:09am
$data = explode("/",$_SERVER['PATH_INFO']); $request = $data[0];Snippets Manager replied on Mon, 2012/05/07 - 2:12pm