Jump to content

array_map prob.


vividona

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.