Ultra fast cheap  linux and windows hosting
See the new scripts recently added to Dynamic Drive. Click here.
Original, practical CSS codes and examples such as CSS menus for your site.
    Search code samples  
 
  Keyword
 
 
 
   
 
 
  Code Samples
 
ASP
CSS
Dhtml
Html
Javascript
PHP
 
   
     LOGIN HERE  
 
Username
Password
Forgot Password
Verify Signup
 
 
 

PHP >> General

How can I tell if a class is defined?

Visitor Ratings (0) :
Description
ou can do it this way:

if(!defined("__PREPEND_INCLUDE_INC__"))
include("$DOCUMENT_ROOT/php3/phplib6/prepend.php3");

and in prepend.php3, I begin with

if(!defined("__PREPEND_INCLUDE_INC__"))
define("__PREPEND_INCLUDE_INC__",1);



Nice way, but you need to manage your includes with an if-statement. An
alternative solution may be

prepend.php3:

if(!defined("__PREPEND_INCLUDE_INC__")) {
define("__PREPEND_INCLUDE_INC__",1);

// your code

}

So you can leave your include simple.
Code
Select All
 Rate this Resource