PHP session_register function (with detailed explanation)

烟雨青岚
Release: 2023-04-08 19:48:02
forward
2667 people have browsed it

PHP session_register function (with detailed explanation)

Usage of PHP session_register function

Syntax:

boolean session_register(string name);
Copy after login

Register new variables.

Return value:Boolean value

Function type:Data processing

Content 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. Returns true value on success.

If you open the session in the header file, that is, use the session_start() function followed by session_register(string name) (such as session_register('username')), then this variable will become a global variable and will affect all Use the file that calls session_start().

Example:

Copy after login

Thank you everyone for reading, I hope you will benefit a lot.

Recommended tutorial: "PHP Tutorial"

The above is the detailed content of PHP session_register function (with detailed explanation). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!