Get the script filename and extension in PHP





3
Date Submitted Mon. Jul. 13th, 2009 3:08 AM
Revision 1 of 1
Scripter Cloudgen
Tags Extension | File | filename | PHP | script
Comments 0 comments
This simple script can be used to get the script filename and extensio

<?php
$t=explode("/",$_SERVER['SCRIPT_NAME']);
$t=explode(".",$t[count($t)-1]);
$strScriptName=$t[0];
$strScriptExtension=$t[1];
?>
 

Comments

There are currently no comments for this snippet.

Voting

Votes Down