Re: check if a file is included
| From: | Jochem Maas | Date: | Fri, 12 Sep 2008 13:05:58 +0000 |
| Subject: | Re: check if a file is included | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-279982@lists.php.net to get a copy of this message | ||
clive schreef:
actually $_SERVER[script_name] is probably better if not being used from a webserver.you didn't mention wanting to use the cmdline. untested code follows: <?php function indirectCall($s) { if (php_sapi_name() == 'cli') { return strstr($s, $argv[0]) !== false; } else { return strstr($s, $_SERVER["REQUEST_URI"]) !== false; } }