There are situations where you may need to get the extension of a given file for a certain purpose.
You may need to get the extension of the file in order to re-size it or you may need to check to see if an uploaded file has a particular extension so as to perform a certain task.
There are numerous ways to do this using PHP.
You can check the physical file type, you can use string position to count in from the end of the string, you can use a regular expression to find the extension, or you can use explode to split the string and then count the array and use the last value in the array as the extension.
All depends on your choice of coding operation and the security requirements.