jj20051 Posted November 8, 2010 Share Posted November 8, 2010 Is there a way to use extract to make session variables? If so how would you go about doing it? Link to comment https://forums.phpfreaks.com/topic/218126-extract-and-session-variables/ Share on other sites More sharing options...
jj20051 Posted November 8, 2010 Author Share Posted November 8, 2010 On a side note is it possible to make a list of variables (IE an array full of variable names) globals? and once again if so how would I do it? Link to comment https://forums.phpfreaks.com/topic/218126-extract-and-session-variables/#findComment-1131859 Share on other sites More sharing options...
AbraCadaver Posted November 8, 2010 Share Posted November 8, 2010 extract() extract an array of variables, values into the current scope (global, local). Some example from you would help, but to make session vars out of individual vars you could: $var1 = 1; $var2 = 2; $_SESSION = compact('var1', 'var2'); As for the other question, that's what extract() is used for. More specifics would help. Link to comment https://forums.phpfreaks.com/topic/218126-extract-and-session-variables/#findComment-1131874 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.