Re: using a pear class or function within a function
| From: | Greg Beaver | Date: | Mon, 28 Apr 2003 17:24:45 +0000 |
| Subject: | Re: using a pear class or function within a function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145547@lists.php.net to get a copy of this message | ||
Hi,
use include_once()
Regards,
Greg
--
phpDocumentor
http://www.phpdoc.org
Mike Jackson wrote:
Hi, I'm having this "scoping" problem. I would like to use a pear class from within a function that I have written, but the methods don't seem to work. For example: function foo() { include('/usr/local/lib/php/Mail.php'); include('/usr/local/lib/php/Mail/mime.php'); $mime = new Mail_mime($crlf); } When I execute this function: Fatal error: Cannot redeclare class mail in /usr/local/lib/php/Mail.php on line 32 Any ideas? I'd also like to call another one of my functions from within a function... Thanks, -- mike