Unnamed
public php v1 · immutablefunction checkfile($attempt, $end, $dir, $default){ foreach(scandir($dir) as $c){ if(strchr($c, $end) == $end){ $files[] = str_replace($end, '', $c); } } if(in_array($attempt, $files)){ return $attempt; } return $default;}