Jump to content

Archived

This topic is now archived and is closed to further replies.

otuatail

$_SESSION standards

Recommended Posts

Can someone tell me which is the correct usage of $_SESSION
I have seen it and used it witha nand without single quoates.

$_SESSION[Data] and $_SESSION['Data']

both of these work and seem to be interchangable. I s there a potential problem with this.

Desmond.

Share this post


Link to post
Share on other sites
yeah normally with $_SESSION[Data] you will be referring to a defined constant named Data therefor always use single- or double quotes

Share this post


Link to post
Share on other sites
When working with arrays, which session variable is you wrap the array key in quotes, unless you use a constant or you;re using a numeric value for the key. The array key is the letters/numbers between the square brakets.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.