<?php /*
   +------------------------------------------------------------------+
   | MikeCherim.com                                                   |
   | PHP: Directory Finder                                            |
   | PHP Hypertext Preprocessor                                       |
   | Copyright Jun 2007                                               |
   | Use with attribution by visible link please!                     |
   | Attribute to: <a href="http://green-beast.com/">Mike Cherim</a>  |
   +------------------------------------------------------------------+
*/
?>

<?php
/*
* Include this scriptlet into a page to extract the info needed.
* Alter numeric position of the part you're after as needed.
*/
?>

<?php
// Break down the request URI into an array of its parts less slashes

     
$path_parts = explode('/', $_SERVER['REQUEST_URI']);

// Define which array item you want to extract and use [1] in my case

       
$path_part = $path_parts[1];

// Return, print, echo that part, or include it in a script   

         
echo $path_part;
?>