Re: PHP_SELF Undefined

From: Date: Mon, 18 Feb 2002 23:29:58 +0000
Subject: Re: PHP_SELF Undefined
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-85307@lists.php.net to get a copy of this message
> $foo = "This page is $_SERVER[PHP_SELF]"; > > Or, better: > > $foo = "This page is {$_SERVER['PHP_SELF']}"; > > You do have to concat to do this in single-quoted (noninterpolated) > strings, though. > > http://www.php.net/manual/en/language.types.string.php#language.types.string .parsing Can you expand on why the first option isn't generally acceptable? I can understand there being an issue with spaces in an index, but is there some other reason that the latter is prefered?

« previous php.general (#85307) next »