How include custom error?

hii i am including some file with include function with if condition

but i want if file is not available that don’t give the full path with error… but i can include some other file instead of that if that’s not exits or some other message instead of error with direcotry

how to write ?


@include('/some/file.php') or @include('/some/other/file.php') or @include('/yet/another/file.php') or die('None of the files could be found ...');

:slight_smile:

thnks

one more question in my mind why we use @ this on some places ?

The @ suppresses errors. See http://php.net/manual/en/language.operators.errorcontrol.php