note 29358 rejected from function.include by tix

From: Date: Tue, 11 Feb 2003 08:36:52 +0000
Subject: note 29358 rejected from function.include by tix
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-43774@lists.php.net to get a copy of this message
One odd thing I found using include/require, was how it reads files from each file. In my particular case, I was calling functions from an included file, which read data from files. The base file also had a few functions which included file access. The problem I ran into, was whenever I called a function from include.php that accessed a file, subsequent calls that involved reading that -same- file, that went called from the include.php, would fail. # base.php include(include.php); fopen(test.txt); # works fclose; opentextfile(test.txt); # works fopen(test.txt); #fails fclose; --------------------------- # include.php function opentextfile($filename) { fopen(test.txt); fclose(); } I am somewhat new to PHP, but as far as I can tell, this isn't normal. if anyone figures out what I'm doing wrong, please contact me.

« previous php.notes (#43774) next »