-
-
$myfile = "./test.txt";
if (is_readable ($myfile)) {
- echo "This file Readable. ", "n";
- } else {
- echo "This file is not readable.", "/n";
- }
-
- if (is_writable ($myfile)) {
- echo "This file is writable." , "/n";
- } else {
- echo "This file is not writable.", "/n";
- }
if (is_executable ($myfile)) {
- echo "This File is executable!", "n";
- } else {
- echo "This file does not have executable permissions", "n";
- }
- ?>
-
Copy code
Attached, detect the size of the file and learn how to use filesize.
-
-
$myfile = "./test.txt";
if (file_exists ($myfile)) {
- $checksize= filesize ($myfile);
- echo "$checksize";
- } else {
- echo "File does not exist!";
- }
- ?>
-
Copy code
|