Several complementary functions of session (1) _ PHP Tutorial

Source: Internet
Author: User
Several complementary functions of session (1 ). In PHP, there are a lot of discussions about Sessions. In fact, there are still several functions in PHP4 that we have not noticed at ordinary times. Let me introduce them to you. Session_set_save _ in PHP, there are a lot of discussions about the session. In fact, there are several functions in PHP4 that we have not noticed at ordinary times.
Let me introduce them to you.
Session_set_save_handler () is really a good thing.
//********************
Session_unset (PHP4 $ # @ 62; = 4.0b4)
Void session_unset (void );
This function can leave all session variables registered to null. Note that it is neither unregister nor destroy.
In the following example, this function is well described.
$ #@ 60 ;? Php
Session_register ("a", "B", "c"); // auto-session-start
$ A = 1;
$ B = 2;
$ C = 3;
Session_unregister ("a"); // unregistrered $
Echo "A: $ a-reg:". session_is_registered ("")."
"; // But the global $ a remains
Session_unset (); // unsets $ B und $ c
Echo "B: $ B-reg:". session_is_registered ("B ")."
"; // The registration remains!
Echo "C: $ c-reg:". session_is_registered ("c ")."
";
Echo session_encode ();
? $ #@ 62;
Output:
A: 1-reg:
B:-reg: 1
C:-reg: 1
! B |! C |

Bytes. Let me introduce them to you. Session_set_save _...

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.