Jump to content


Photo

$_SESSION standards


  • Please log in to reply
2 replies to this topic

#1 otuatail

otuatail
  • Members
  • PipPipPip
  • Advanced Member
  • 961 posts

Posted 01 October 2006 - 12:46 PM

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.


#2 ignace

ignace
  • Moderators
  • Now mod flavored
  • 6,431 posts
  • LocationBelgium

Posted 01 October 2006 - 12:54 PM

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

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 01 October 2006 - 02:01 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users