note 97508 modified in function.debug-backtrace by danbrown
| From: | danbrown@php.net | Date: | Fri, 23 Apr 2010 12:33:49 +0000 |
| Subject: | note 97508 modified in function.debug-backtrace by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-168553@lists.php.net to get a copy of this message | ||
This can be used to show if a file is being accessed directly or being included/called from another:
<?php
if (count(debug_backtrace()) == 0){
// Do something
}
?>
--was--
if (count(debug_backtrace()) == 0){
}
can be used to show if a file is being accessed directly or being included/called from another.
http://php.net/manual/en/function.debug-backtrace.php