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
$fname
$pClass
text-
You can use in_array() to compare a value to multiple strings:
in_array()
if(in_array($ext, array('txt','rtf','log','docx')){ // Value is found. }