note 52869 deleted from function.session-decode by nlopess

From: Date: Sun, 21 Oct 2007 21:59:44 +0000
Subject: note 52869 deleted from function.session-decode by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-131603@lists.php.net to get a copy of this message
Note Submitter: Sasha Rudenko ---- Here is fixed function which was described here function unserializesession($data) { $vars=preg_split('/([a-z_,A-Z_]+)\|/',$data,-1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); for($i=0; $vars[$i]; $i++) { $result[$vars[$i++]]=unserialize($vars[$i]); } return $result; } I've just fix regexp, it doesn't handle names with _ (underline) sign. But anyway, thanks for author, this function was very useful for me :)

« previous php.notes (#131603) next »