PHP: File extension using PHP built-in function
Posted: 2011/08/29 in Development, PHP
Came across this amazing, simple feature in PHP Strings: How to Get the Extension of a File by “Stoimen” where the problem of getting a file’s “extension” is solved simply.
Best part is that this uses PHP to get the extension of a file. As the author notes, this lets us rely on really smart people who have to do a good job.
EQUALLY great are the two comments (as of my posting this):
What I love about this simple, single post is that I learned about pathinfo, end, and have yet another tool in my SPL toolbelt. Awesome.