Re: include file identifier

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

 



On Saturday 03 February 2007 7:27 pm, Eli wrote:
> Robert Cummings wrote:
> > Looking at the code above... it would seem you want:
> >
> >     include_once()
>
> It's not the idea..
>
> I'm not trying to make that code work, I want to know which exact
> include (of the same file) does what..

Huh?

> Say you got a loop of self-include:
> e.g:
> === a.php
> <?php
> echo "\nRunning ".__FILE__." (id=X)!\t";
> if ($visited<5) {
> 	echo "You are visiting here!";
> 	$visited++;
> 	include(__FILE__);
> }
> else {
> 	echo "That's enough! Bye!";
> }
> ?>
>
> In "(id=X)!".. what's the X? You may say you can use $visited as an
> identifier, but it's not the point I mean.. I want a global include file
> identifier, that is not dependent on other variables.

realpath(__FILE__) will give you the absolute path on the server of the 
current file, which is unique.  Why you want that for what you're doing I 
have no idea, but it's the only unique identifier I can think of that isn't a 
variable or constant.  (Well, it is a constant, but you get the idea.  I 
suppose.)

The fact that you even want something like that, however, scares me.

-- 
Larry Garfield			AIM: LOLG42
larry@xxxxxxxxxxxxxxxx		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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