otuatail Posted October 1, 2006 Share Posted October 1, 2006 Can someone tell me which is the correct usage of $_SESSIONI 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. Quote Link to comment https://forums.phpfreaks.com/topic/22655-_session-standards/ Share on other sites More sharing options...
ignace Posted October 1, 2006 Share Posted October 1, 2006 yeah normally with $_SESSION[Data] you will be referring to a defined constant named Data therefor always use single- or double quotes Quote Link to comment https://forums.phpfreaks.com/topic/22655-_session-standards/#findComment-101791 Share on other sites More sharing options...
wildteen88 Posted October 1, 2006 Share Posted October 1, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/22655-_session-standards/#findComment-101815 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.