session variables
Posted: Thu Aug 18, 2005 8:13 pm
I'm trying to extract a variable from a string within a session record in a MYSQL database. During a session this is obviously no problem as I can call "$_SESSION['value']['user_id']", however, I am writing a garbage collection routine that will remove records in other tables based on this user id which is in the value array of the session record.
What I need is a parse routine that I can call within the gc function to give me this value ... PHP obviously does this to give me the value in the example above, but I don't think I have access to this from the gc function. The string looks something like this:
value|a:2:{s:7:"user_id";s:2:"5";s:9:"user_type";s:1:"3";}
Any help would be appreciated - or is there an easier way to go about this?
Thanks
Nog.
What I need is a parse routine that I can call within the gc function to give me this value ... PHP obviously does this to give me the value in the example above, but I don't think I have access to this from the gc function. The string looks something like this:
value|a:2:{s:7:"user_id";s:2:"5";s:9:"user_type";s:1:"3";}
Any help would be appreciated - or is there an easier way to go about this?
Thanks
Nog.