vividona Posted March 26, 2011 Share Posted March 26, 2011 Plz check the following code. It gave me this error Warning: array_map(): The first argument, 'self::prepSessions', should be either NULL or a valid callback public function resetSess(){ if($this->isLoggedIn){ session_regenerate_id(); $this->sessions = array( 'userId' => $_SESSION['userId'], 'username' => $_SESSION['username'], 'password' => $_SESSION['password'], 'uemail' => $_SESSION['uemail'], 'userLevel' => $_SESSION['userLevel'], 'userGroup' => $_SESSION['userGroup'], 'referrer' => $_SESSION['referrer'] ); $this->userdata = array_map("self::prepSessions", $this->sessions); }else{ return false; } } public function prepSessions($sessions){ if($this->isLoggedIn){ return $sessions; } } Link to comment https://forums.phpfreaks.com/topic/231767-array_map-prob/ Share on other sites More sharing options...
flolam Posted March 26, 2011 Share Posted March 26, 2011 the array_map should be array_map(array("className", "prepSessions"), $this->sessions)) where, of course, className is to be replaced with whatever classname you have Link to comment https://forums.phpfreaks.com/topic/231767-array_map-prob/#findComment-1192480 Share on other sites More sharing options...
vividona Posted March 28, 2011 Author Share Posted March 28, 2011 the array_map should be array_map(array("className", "prepSessions"), $this->sessions)) where, of course, className is to be replaced with whatever classname you have It works! thank you sooo much, flolam Link to comment https://forums.phpfreaks.com/topic/231767-array_map-prob/#findComment-1193167 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.