Anil Kumar Nelakuditi Anil Kumar Nelakuditi - 1 month ago 7
HTML Question

Message to display for zero byte file in PHP

i have 0 byte file (assume anil.txt)under /nrt/www/AAAA/RRRR/ directory.
now i need a Php script where i need to check anil.txt file and if it zero byte files i need to display message.

Answer

You should use filesize function. You're a newbie, because of that I am adding the code here but please write some code first next time, than you can ask for our help.

Example code:

<?php
    $size = filesize('path/to/your/file');

    if ($size === 0) {
     //do something here
    }