SplFileInfo::isLink

(PHP 5 >= 5.1.2, PHP 7) Tells if the file is a link public bool SplFileInfo::isLink ( void ) Use this method to check if the file referenced by the SplFileInfo object is a link. Returns: Returns TRUE if the file is a link, FALSE otherwise. Examples: SplFileInfo::isLink() example <?php $info = new SplFileInfo('/path/

SplFileInfo::isFile

(PHP 5 >= 5.1.2, PHP 7) Tells if the object references a regular file public bool SplFileInfo::isFile ( void ) Checks if the file referenced by this SplFileInfo object exists and is a regular file. Returns: Returns TRUE if the file exists and is a regular file (not a link), FALSE otherwise. Examples: SplFileInfo::isFile() example

SplFileInfo::isExecutable

(PHP 5 >= 5.1.2, PHP 7) Tells if the file is executable public bool SplFileInfo::isExecutable ( void ) Checks if the file is executable. Returns: Returns TRUE if executable, FALSE otherwise. Examples: SplFileInfo::isExecutable() example <?php $info = new SplFileInfo('/usr/bin/php'); var_dump($info->isExecutable()

SplFileInfo::isDir

(PHP 5 >= 5.1.2, PHP 7) Tells if the file is a directory public bool SplFileInfo::isDir ( void ) This method can be used to determine if the file is a directory. Returns: Returns TRUE if a directory, FALSE otherwise. Examples: SplFileInfo::isDir() example <?php $d = new SplFileInfo(dirname(__FILE__)); var_dump($d-&g

SplFileInfo::getType

(PHP 5 >= 5.1.2, PHP 7) Gets file type public string SplFileInfo::getType ( void ) Returns the type of the file referenced. Returns: A string representing the type of the entry. May be one of file, link, or dir Exception: Throws a RuntimeException on error. Examples: SplFileInfo::getType() example <

SplFileInfo::getSize

(PHP 5 >= 5.1.2, PHP 7) Gets file size public int SplFileInfo::getSize ( void ) Returns the filesize in bytes for the file referenced. Returns: The filesize in bytes. Exception: A RuntimeException will be thrown if the file does not exist or an error occurs. See also: filesize() -

SplFileInfo::getRealPath

(PHP 5 >= 5.2.2, PHP 7) Gets absolute path to file public string SplFileInfo::getRealPath ( void ) This method expands all symbolic links, resolves relative references and returns the real path to the file. Returns: Returns the path to the file, or FALSE if the file does not exist. Examples: SplFileInfo::getRealPath() example

SplFileInfo::getPerms

(PHP 5 >= 5.1.2, PHP 7) Gets file permissions public int SplFileInfo::getPerms ( void ) Gets the file permissions for the file. Returns: Returns the file permissions. Examples: SplFileInfo::getPerms() example <?php $info = new SplFileInfo('/tmp'); echo substr(sprintf('%o', $info->getPerms()), -4); $info = new Sp

SplFileInfo::getPathname

(PHP 5 >= 5.1.2, PHP 7) Gets the path to the file public string SplFileInfo::getPathname ( void ) Returns the path to the file. Returns: The path to the file. Examples: SplFileInfo::getPathname() example <?php $info = new SplFileInfo('/usr/bin/php'); var_dump($info->getPathname()); ?> The above example will

SplFileInfo::getPathInfo

(PHP 5 >= 5.1.2, PHP 7) Gets an SplFileInfo object for the path public SplFileInfo SplFileInfo::getPathInfo ([ string $class_name ] ) Gets an SplFileInfo object for the parent of the current file. Parameters: class_name Name of an SplFileInfo derived class to use. Returns: Returns an SplFileInfo object for the parent path of the file.