note 23924 deleted from function.class-exists by dams
| From: | dams@php.net | Date: | Fri, 02 Aug 2002 10:48:43 +0000 |
| Subject: | note 23924 deleted from function.class-exists by dams | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-34140@lists.php.net to get a copy of this message | ||
To avoid the "Cannot redeclare class"-error, you can use
require_once ("ClassName");
instead of require ("ClassName");
If you use this, PHP doesn't try to declare the class a second time.
Even easier to use than:
if ( !class_exists( YourClass ) )
as stated in the previous message.