Anil Kumar Nelakuditi Anil Kumar Nelakuditi - 3 months ago 20
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.


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:

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

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