Forum Moderators: coopster
<?php
# get the filename = REQUEST_URI is also an option, but maybe less secure?
$filename=$_SERVER['SCRIPT_FILENAME'];
# match the part before .php
preg_match('#.*/([^\.]+).php$#',$filename,$matches);
$filename_part=$matches[1];
# test output
echo "<h1>$filename_part</h1>";
?>