I have a filename($fname) and I need to assign $pClass to the file type with a \"-\" afterwards. Currently I always get text-, no matt
I would simply change it to something like this:
//This gets the extention for the file and assigns the class to the icon
$pieces = explode('.', $fname);
$ext = array_pop($pieces);
if(in_array($ext,array('txt','rtf','log','docx'))){
$pClass = 'text-';
}elseif(in_array($ext,array('zip','sitx','7z','rar','gz'))){
$pClass = 'archive-';
}elseif(in_array($ext,array('php','css','html','c','cs','java','js','xml','htm','asp'))) {
$pClass = 'code-';
}elseif(in_array($ext,array('png','bmp','dds','gif','jpg','psd','pspimage','tga','svg'))){
$pClass = 'image-';
}else {
$pClass = '';
}