F::is PHP Method

is() public static method

Checks if a file is of a certain type
public static is ( string $file, string $value ) : boolean
$file string Full path to the file
$value string An extension or mime type
return boolean
    public static function is($file, $value)
    {
        if (in_array($value, static::extensions())) {
            // check for the extension
            return static::extension($file) == $value;
        } else {
            if (strpos($value, '/') !== false) {
                // check for the mime type
                return static::mime($file) == $value;
            }
        }
        return false;
    }