note 25950 rejected from function.require by nicos
| From: | nicos@php.net | Date: | Sat, 12 Oct 2002 12:24:51 +0000 |
| Subject: | note 25950 rejected from function.require by nicos | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-37976@lists.php.net to get a copy of this message | ||
require()-ing a file twice will usually produce errors because functions can't be redefined.
This is a problem when running a.php when a.php requires b.php and c.php and b.php also requires
c.php. To solve this problem in a "C" style use this code:
c.php:
<?php
if (!isset($_c_)) {
global $_c_; $_c_ = true;
//normal php code
}
?>