Ok, so it is late and I did this the hard way, you can bash me for that :-P. But anyways, does anyone know of a quicker and more efficient command or way to get the exact file name from the URL without the file extension. (Like if I am on www.crap.com/stuff/index.php I just want index to come out of it.) This does the job for me, but I must say that I am sure there is a better way.
<?php
$page = $_SERVER['SCRIPT_NAME'];
$page = explode('.', $page);
$page = explode('/', $page[0]);
$cnt = count($page);
$cnt--;
$page = $page[$cnt];
echo $page;
?>
Thanks. 🙂