uri_part: A PHP Function for Working with the Current URI
A PHP function that makes it extremely easy to display dynamic content within your existing Content Management System (CMS), web application framework or standard “PHP-enabled” website.
function uri_part($n) {
$path = explode(“/”, $_SERVER["REQUEST_URI"]);
for ($i = 0; $i <= count($path); $i++) {
if(is_null($path[$i]) || $path[$i] == “”) {
unset($path[$i]);
}
}
$path = array_values($path);
switch($n) {
case 0: return @$path[0]; break;
case 1: return @$path[1]; break;
case …

