(No, no, no. I'm not being critical.)
How, in the following function can I indicate by the return value that the file was not successfully opened?
Code: Select all
function listall($name)
{
$f = fopen($name, "r");
if ($f != FALSE)
{ $a = fread($f, filesize($name)); // read the whole file
fclose($f);
$a = trim($a);
$r = explode("~", $a);
return $r;
}
else return ??????;
}Code: Select all
if (listall($Filename))
// do one thing
else // do something different