using a pear class or function within a function

From: Date: Mon, 28 Apr 2003 13:56:54 +0000
Subject: using a pear class or function within a function
Groups: php.general 
Request: Send a blank email to php-general+get-145530@lists.php.net to get a copy of this message
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

« previous php.general (#145530) next »