is there a way that i can include a file and know whether it worked nicely?
i have a function that loads custom classes for different purposes
and i'd like something like this
(but not actually this because i don't believe include() actually returns anything that is useful to me)
Code: Select all
$file = "giantmonkeys.php";
if(file_exists($file))
{
if (include("$file"))
{
echo "<br>it worked!";
// then do some thing useful with the functions and classes
// included in the file
}
else
{
echo "<br>hmm.. something seems to have gone wrong";
//gracefully continue on without included functions and classes
}
}any one got any suggestions?
cheers
mathew