I am trying check the file size before uploading to the page. If the size is less than 10 bytes then nothing should display.
Is this the right way to do it? or do i need to change the 10 to something else?
<?php
$newsFile = "news.txt";
$Size = ($newsFile);
$myfile = fopen($newsFile, "r") or die("Unable to open file!");
if($Size < 10) {
echo "File is not big enough";
}
else {
while(!feof($myfile)) {
echo fgets($myfile) . "<br>";
}
}