Thursday, September 5, 2013

IF file is !empty ELSE

IF file is !empty ELSE

So, if i have a file that when its empty it requires a specific function,
but if the file is NOT empty it will proceed to show (else) something
else. This is currently the format I am using. I have tired several
different manners and variations of doing so (from PHP Manual examples to
StackOverFlow Q/A). What it is doing is showing me the else not the if,
since the file is actually empty...
<?
$file = 'config/config2.php';
if(!empty($file))
{
some code here!
}
else
{
some other code here!
}
?>

No comments:

Post a Comment