Session_register function in PHP

Source: Internet
Author: User
: 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.