Oops,
Sorry about that.
$info_1 would be (create?) when you run call this function like this:
insert_info_into_session('cart',1);
In theory, this would set $info_1 to GLOBAL scope in this line:
GLOBAL $info_{$num_of_cookie};
but it's not working for me.
Any ideas why?
I've looked at PHP.net and can't even find a reference to GLOBAL.
Bryan
p.s. Here is the code again, slightly modified.🙂
FUNCTION insert_info_into_session($array_w_q_data,$num_of_cookie) {
GLOBAL ${$array_w_q_data};
GLOBAL $info{$num_of_cookie};
$info{$num_of_cookie} = serialize(${$array_w_q_data});
session_register("$info_{$num_of_cookie} ");
return;
};