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..." 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<-] 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
Archived
This topic is now archived and is closed to further replies.