Write a PHP program to get the size of a file.
<?php $myfile = fopen("/home/students/ppp.txt", "w") or die("Unable to open file!"); $txt = "PHP Exercises\n"; fwrite($myfile, $txt); $txt = "from\n"; fwrite($myfile, $txt); $txt = "w3resource\n"; fwrite($myfile, $txt); fclose($myfile); echo "Size of the file: ".filesize("/home/students/ppp.txt")."\n"; ?>
Sample Output:
Size of the file: 30
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer