For example if you have current URL like http://tut2learn.com/contactus.php. Here now we going to parse a script name.
Here script name is contactus.php but we need only contactus. Just follow below one line script we can get exact script name.
$script_name = str_replace(".php", "", basename($_SERVER["SCRIPT_NAME"])); echo $script_name;
The Output is contactus.
Thats all! Have a nice day!