/ Published in: PHP
works with fugue icons, but can be custumized
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function extensionToIcon($filename) { $icnext = "png"; { $icnext = "gif"; } if($ext == ".pdf") { return "document_text_image.$icnext"; } { return "film.$icnext"; } { return "music_beam_16.$icnext"; } { return "image.$icnext"; } { return "document_text.$icnext"; } { return "document_word_text.$icnext"; } { return "document_excel_table.$icnext"; } { return "database.$icnext"; } { return "document_zipper.$icnext"; } else if($ext == $filename) { return "folder_horizontal_open.$icnext"; } else { return "document.$icnext"; } }