Is it a file: is_file() : File Property « File Directory « PHP






Is it a file: is_file()

<html>
<head>
<title>Is it a file: is_file()</title>
</head>
<body>
<?php
$file = "test.txt";
outputFileTestInfo( $file );
function outputFileTestInfo( $f ){
   if ( ! file_exists( $f ) ){
       print "$f does not exist<BR>";
      return;
   }
   print "$f is ".(is_file( $f )?"":"not ")."a file<br>";
}
?>
</body>
</html>

           
       








Related examples in the same category

1.Is the file a directory: is_dir()
2.Is the file readable: is_readable()
3.Is the file writable: is_writable()
4.File changed time
5.File modified time
6.File accessed time
7.Checking the Mode of a File
8.Determining the Size of a File
9.Get the file size: filesize
10.Is the file executable: is_executable
11.filegroup: Gets file group
12.File last changed time
13.File last accessed time
14.Get the file owner
15.Get file permission
16.File last updated time