I have a script that browses a sessions table and extracts and displays the session values for display. The function below (I don't remember where I got it) extracts session data without starting a session, but it doesn't handle session values that are arrays.
Anyone have something like this that works?




function sess_string_to_array($sd)
{
   $sess_array = array();
   $vars = preg_split('/[;}]/', $sd);

   for ($i=0; $i < sizeof($vars); $i++)
   {
      $parts = explode('|', $vars[$i]);
      $key = $parts[0];
      $val = unserialize($parts[1].";");

      $sess_array[$key] = $val;
   }

   return $sess_array;
}


aw


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to