Re: check if a file is included

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
	}
}








--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux