$file{0} == "c" && $file{1} == "o" && $file{2} == "m" && $file{3} == "_"
Ti suggerisco di fare un salto su http://www.php.net/substr e http://www.php.net/preg_match