Re: [PHP4BETA] Session with MySQL
| From: | 'Sascha Schumann' | Date: | Sat, 18 Sep 1999 07:23:20 +0000 |
| Subject: | Re: [PHP4BETA] Session with MySQL | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-4602@lists.php.net to get a copy of this message | ||
On Fri, Sep 17, 1999 at 05:03:29PM -0700, John Hamlik wrote:
> Thank you for adding the user interface for the session object, I will
> be testing shortly.
>
> In our session module we have the ability to prefix a variable with s_
> so that it is automatically registered as a session variable. This
> saves us the time of calling session_register for all of the variables.
>
> It seems like I would need a tie into session_start() in order to
> duplicate this functionality. Is this possible?
Possible, yes, feasible, no. It's easier to write a short
function which does what you want:
function global_register() {
for(reset($GLOBALS); $var = key($GLOBALS); next($GLOBALS)) {
if(substr($var, 0, 2) == "s_")
session_register($var);
}
}
--
Regards,
Sascha Schumann
Consultant