Created
September 29, 2011 09:40
-
-
Save daGrevis/1250407 to your computer and use it in GitHub Desktop.
Get file's extension, the simple and fast way
This file contains 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 | |
echo pathinfo($filename, PATHINFO_EXTENSION); | |
// Where `$filename` can be path to file, only file etc.. | |
// P.S. Of course, it can be `exe` file, just renamed to `virus.exe.jpg`, and it will say that it's `jpg`. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment