Re: A little help needed - get_filename() and get_linenum()

From: Date: Wed, 04 Sep 2002 13:54:03 +0000
Subject: Re: A little help needed - get_filename() and get_linenum()
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-87904@lists.php.net to get a copy of this message
Hello! You probably did not see magic constants __FILE__ and __LINE__ in PHP manual ? Check this: http://si.php.net/manual/en/language.constants.php Cheers, Dejan "Dan Hardiker" <dhardiker@staff.firstcreative.net> wrote in message news:10119.193.237.249.44.1031146565.squirrel@adam.firstcreative.net... | Hi All, | | Im looking at developing a couple of functions which could retrieve the | current line number, and filename where ever they are put. By file name, I | mean the actual file name, not the parent (eg: the file that included this | one)... very similar to what would be outputted in a syntax error or such. | | A scenario where this would be useful would be in include files: | | <?php | if ($_SERVER["SCRIPT_FILENAME"] == get_filename()) { | die("Dont talk to me!"); | // or a header redirect, you get the jist | } | ?>

« previous php.dev (#87904) next »