Created
September 5, 2016 10:53
-
-
Save otkrsk/1cfb36bc7f9081b34dd074acef8aceb1 to your computer and use it in GitHub Desktop.
Get a file's name or extension (or any other part)
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 | |
| $name = pathinfo($file, PATHINFO_FILENAME); // returns filename | |
| $ext = pathinfo($file, PATHINFO_EXTENSION); // returns extension |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment