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

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

 



On Wed, 15 Sep 2021 10:38:58 +0100, Ashley Sheridan <ash@xxxxxxxxxxxxxxxxxxxx>
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



[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