Hi lets say my url is www.mywebsite.com/category/music
how could I dynamically add a page title of the last part of the url which in this case is music. but as the the url changes how to grab the last part of that url.
<title><?php echo basename($_SERVER['REQUEST_URI']); ?></title>
<title><?php echo trim($_SERVER["REQUEST_URI"],"/");?></title>