note 104663 modified in function.session-register by danbrown

From: Date: Wed, 29 Jun 2011 15:36:32 +0000
Subject: note 104663 modified in function.session-register by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-181053@lists.php.net to get a copy of this message
in addition to function set_session_vars instead of replacing all $var with $_SESSION['var'], you could get all set session-vars in prevoius scripts with this function <?php function get_session_vars() { $nb_args=func_num_args(); $arg_list=func_get_args(); for($i=0;$i<$nb_args;$i++) { global $$arg_list[$i] = $_SESSION[$arg_list[$i]]; } } ?> --was-- in addition to function set_session_vars instead of replacing all $var with $_SESSION['var'], you could get all set session-vars in prevoius scripts with this function function get_session_vars() { $nb_args=func_num_args(); $arg_list=func_get_args(); for($i=0;$i<$nb_args;$i++) { global $$arg_list[$i] = $_SESSION[$arg_list[$i]]; } } http://php.net/manual/en/function.session-register.php

« previous php.notes (#181053) next »