After changing the Php environment today, we found a message indicating the Deprecated: Functionsession_register () isdeprecated error. let's first look at the code: & lt ;? PhpFixforremov
After changing the Php environment today, we found a message indicating the Deprecated: Function session_register () is deprecated error. let's first look at the code:
- // Fix for removed Session functions
- Function fix_session_register (){
- Function session_register (){
- $ Args = func_get_args ();
- Foreach ($ args as $ key ){
- $ _ SESSION [$ key] = $ GLOBALS [$ key];
- }
- }
- Function session_is_registered ($ key ){
- Return isset ($ _ SESSION [$ key]);
- }
- Function session_unregister ($ key ){
- Unset ($ _ SESSION [$ key]);
- }
- }
- If (! Function_exists ('session _ register ') fix_session_register ();
- ?>
I checked that there were not many issues. I found another method to directly
Session_register ("abc"); change to $ _ SESSION ['ABC'] = null;
Summary:From the above process, we can see that this function has been deleted in PHP5.3. That is, this function is no longer available. you can simply use the following method.