yanknudtskov
11/26/2014 - 11:52 AM

WordPress get file extension

WordPress get file extension

<?php

function get_file_extension($file) {
    $file_type_array = wp_check_filetype($file);
    if($file_type_array)
    {
        return $file_type_array['ext'];
    }

    return ''; 
}

?>