php中的$ _session ['']和$ _session [“”]之间的区别

I searched but didn't find a question about this. Is there a difference between $_session['var'] and $_session["var"] in PHP?

I know the difference of single and double quotes at the echo command but can't figure out the above. At my testing server it works fine both ways, but is there something deeper?

Difference is as follows:-

Eg: $key = 'demo';
In single quote, 
$_SESSION['$key'] = $key; wont work.
But in double quotes,
$_SESSION["$key"] = $key; works.

Means you can pass php variable directly in double quotes but not in single quote.

When you write something in "", it gets parsed and written in '' never get parsed, echo's data as it is.

for example

$cur = 10;

echo "i need USD $cur.";

it will parse "" and will output as : i need USD 10.

but if you put it in ''

echo 'i need USD $cur.';

it will not parse it and output as : i need USD $cur.

Same thing applies for SESSION too. single quote works faster than double quote.

"" or '' both aren't different in $_SESSION[], unless you want to put variables on it, just like $_SESSION["session_$sesscode"]

actually difference between " " and ' '. Whenever you write something inside ' ' it will consider as string. it cant recognize any variable or like this. but " " is working for both string and variable.

example:

$foo = 10;
echo '$foo';
output: $foo;

again for " ",

echo "$foo";
output: 10;

when you write $_session["$var"]. it will work.

but if you write $_session['$var'] not going to work.

here $var is a variable. value can be $var = 'var' or like this.