File::type PHP Method

type() public static method

Get the file type of a given file.
public static type ( string $path ) : string
$path string
return string
        public static function type($path)
        {
            return \Illuminate\Filesystem\Filesystem::type($path);
        }

Usage Example

Example #1
0
 public static function isSameType(File $origin, $filename)
 {
     $extensions = explode('.', pathinfo($filename, PATHINFO_BASENAME));
     array_shift($extensions);
     return $origin->type() == array_shift($extensions);
 }
All Usage Examples Of File::type