MDanz Posted June 2, 2011 Share Posted June 2, 2011 $_SESSION[$c] is an array in a loop. How do i do an if statement that gets the current array key? if($_SESSION[$c][]==$_SESSION[$c][1]) { } i tried the above but i get this error "Fatal error: Cannot use [] for reading in..." Quote Link to comment https://forums.phpfreaks.com/topic/238221-get-current-array-key-help/ Share on other sites More sharing options...
dougjohnson Posted June 2, 2011 Share Posted June 2, 2011 I think you need an array index number in: if($_SESSION[$c][->index#here<-] Quote Link to comment https://forums.phpfreaks.com/topic/238221-get-current-array-key-help/#findComment-1224182 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.