@include_once($mandator.'/footer.php') == 'OK')
Posted: Thu Jun 23, 2005 10:14 am
hi
i like to write smart code (as i belive)
my question is, if it's faster or better to write:
or that:
i like the second one.
i think that php first checks if the file exist when including. am i right?
i like to write smart code (as i belive)
my question is, if it's faster or better to write:
Code: Select all
//include files that possibly are overwritten
if (file_exists($mandator.'/footer.php'))
{
include_once($mandator.'/footer.php');
}
else
{
include_once('footer.php');
}Code: Select all
//include files that possibly are overwritten
if (!@include_once($mandator.'/footer.php') == 'OK')
{
include_once('footer.php');
}i think that php first checks if the file exist when including. am i right?