Get File Extension
Created by: Assaad Youssef Abou-Rached
There are many ways to extract the file extension, the easiest way is to use the built-in function pathinfo().
Since pathinfo() is disabled for secrurity reasons, we will write a simple function that takes a file name as input and returns its extension using substr()
The following code will return: php