use p() for the output and not for the comparison

$file['type']use p() for the output and not for the comparison