: This article describes the session_register function in PHP. if you are interested in the PHP Tutorial, refer to it. Syntax: boolean session_register (string name );
Register a new variable.
Return value: Boolean
Function type: data processing
Description
This function adds a variable to the current Session in the global variable. The parameter name is the name of the variable to be added. If the call succeeds, the return value is true.
If the session is enabled in the header file, that is, the session_register (string name) (for example, session_register ('Username') is added to the session_start () function, this variable becomes a global variable, all files that call session_start () will be affected.
For example:
Session_start ();
$ Username = 'test ';
Session_register ('Username ');
Echo $ _ session ['username']; // output test
?>
The above describes the session_register function in PHP, including the relevant content, and hopes to help those who are interested in the PHP Tutorial.