Deprecated: Functionsession_register () isdeprecated

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

  1. // Fix for removed Session functions
  2. Function fix_session_register (){
  3. Function session_register (){
  4. $ Args = func_get_args ();
  5. Foreach ($ args as $ key ){
  6. $ _ SESSION [$ key] = $ GLOBALS [$ key];
  7. }
  8. }
  9. Function session_is_registered ($ key ){
  10. Return isset ($ _ SESSION [$ key]);
  11. }
  12. Function session_unregister ($ key ){
  13. Unset ($ _ SESSION [$ key]);
  14. }
  15. }
  16. If (! Function_exists ('session _ register ') fix_session_register ();
  17. ?>

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.

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.