How many ways I can register the variables into session? ~ Interview Questions & Answers

Tuesday, December 15, 2009

How many ways I can register the variables into session?

Global variables in PHP can be registered using the session_register() function. It accepts different number of arguments, any of which can be either a string holding the name of a variable or an array consisting of variable names or other arrays
Example:
Session_register(“simple”);
$_session can also be used for registering variables.
Example:
$_SESSION['count'] = 0;