PHP File Tips - Part 8: If you want to get some information from a particular file, you can use some function such as filesize(), filetype(), and more. Like this:
<?php
$f = "test.txt";
// file type
$type = filetype($f);
echo "Type is ".$type;
// file size
$size = filesize($f);
echo "Size is ".$size." bytes ";
// writeable?
echo is_writable($f) ? "writable" : "not writable";
// readable?
echo is_readable($f) ? "readable" : "not readable";
// executable?
echo is_executable($f) ? "executable" : "not executable";
?>