whelpton Posted March 15, 2009 Share Posted March 15, 2009 Hello, Is there anyway of checking if a text file is blank? I cant seem to find a function anywhere in the manual for this. Thanks Quote Link to comment Share on other sites More sharing options...
trq Posted March 15, 2009 Share Posted March 15, 2009 filesize will return 0 if the file is empty. Quote Link to comment Share on other sites More sharing options...
Rodis Posted March 15, 2009 Share Posted March 15, 2009 Use the function empty() For example $file = file_get_contents("file.txt"); if (empty($file)){ echo "This file is empty"; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.