[PHP] Include if file exists?

2004-08-27 Thread Jay
Hi! Is there a ready to use PHP function for including ONLY if the file exists? I tried it like this: [main.php] include_once(lib.php); later includeIf(somefile.php); [lib.php] function includeIf($filename) { if (!file_exists($filename)) {

Re: [PHP] Include if file exists?

2004-08-27 Thread Matt M.
On Fri, 27 Aug 2004 12:16:32 +0200, Jay [EMAIL PROTECTED] wrote: Hi! Is there a ready to use PHP function for including ONLY if the file exists? I tried it like this: [main.php] include_once(lib.php); .later includeIf(somefile.php); [lib.php] function includeIf($filename) {

Re: [PHP] Include if file exists?

2004-08-27 Thread John Nichel
Jay wrote: Hi! Is there a ready to use PHP function for including ONLY if the file exists? I tried it like this: [main.php] include_once(lib.php); later includeIf(somefile.php); [lib.php] function includeIf($filename) { if (!file_exists($filename)) { include_once($filename);