Re: How can I replace $_SERVER["DOCUMENT_ROOT"] in PHP 7.0?

[email protected] (Bo Berglund)
Newsgroups php.general
Message-ID <[email protected]>
On Wed, 15 Sep 2021 10:38:58 +0100, Ashley Sheridan <[email protected]>
wrote:

>>> No, $_SERVER['DOCUMENT_ROOT'] is a string, just echo out what it
>>> actually is on both versions of PHP. That would show you what you now
>>> know, that it's different for whatever reason. It could be a script
>>> being run that's altering it, it could be a change in server config, not
>>> easy to tell without more digging.
>> Does it matter if I use
>> $_SERVER["DOCUMENT_ROOT"] rather than
>> $_SERVER['DOCUMENT_ROOT']
>>
>> In the code I am struggling with it uses double quotes rather than single quotes
>> as you show here,
>>
>The only difference between single and double quote is how PHP handles 
>string interpolation, e.g.:
>
>$var = 'something';
>echo "this is $var";
>echo 'this is $var';
>
>Will give you the output:
>
>this is something
>this is $var

So that works like bash in shellscripts then!
Good to know.

-- 
Bo Berglund
Developer in Sweden
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.