Created
July 7, 2012 09:41
-
-
Save toshimaru/3065643 to your computer and use it in GitHub Desktop.
php get filename.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* via: http://nanoca.me/relaxtyle/blog/2011/07/php-1.html | |
*/ | |
// 現在表示されているファイル名取得 | |
$path=$_SERVER["PHP_SELF"]; | |
// パスつきのファイル名取得 | |
$filename=basename($_SERVER["PHP_SELF"]); | |
// ファイル名のみ | |
$filename=basename($_SERVER["PHP_SELF"],".php"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment