Search results for 'get current file'. 1 post(s) found.

  1. 2007/10/16 How to get current filename as variable ?
2007/10/16 08:45

How to get current filename as variable ?


Sometimes you need just the filename of the current script, without the path. This snippet does just that using the SCRIPT_NAME and explode function.

<?
    $currentFile = $_SERVER["SCRIPT_NAME"];
    $parts = Explode('/', $currentFile);
    $currentFile = $parts[count($parts) - 1];
?>

Another posts included in "PHP"

How to redirect browser in PHP ? (0)2007/10/16
PHP date and time formatting (0)2007/10/16
How to declare array in PHP like C/C++ (0)2007/10/16
email validation, simple (0)2007/10/16
How to ban / block IP addresses (0)2007/10/16
for loop - simple (0)2007/10/16
form action - detect form post (0)2007/10/16
How to make random number ? (0)2007/10/16
Trackback 3 Comment 0

Trackback : Cannot send a trackbact to this post.

  1. Subject different money making ideas

    Tracked from moneyideas 2010/01/29 04:13 delete

    moneyideas

  2. Subject different money making ideas

    Tracked from moneyideas 2010/01/29 13:02 delete

    moneyideas

  3. Subject different money making ideas

    Tracked from moneyideas 2010/01/31 16:42 delete

    moneyideas