PHP Tutorial Imitate ASP Tutorial Application object Online population statistics
Usage:
Application (' key ', ' value '); Set Key=value
$value = Application (' key '); Get the value of key
*/
function Application ()
{
$args = Func_get_args (); Get input parameters
if (count ($args) >2 | | count ($ARGS) < 1) return;
$ssid = session_id (); Save current session_id
Session_write_close (); End Current session
Ob_start (); Disable Global Session Send header
session_id ("xxx"); Registering a global session_id
Session_Start (); Turn on global session
$key = $args [0];
if (count ($args) = = 2)//If there is a second argument, then the global session is written
{
$re = ($_session[$key] = $args [1]);
}
else//If there is only one argument, return the value corresponding to the parameter
{
$re = $_session[$key];
}
Session_write_close (); End Global Session
session_id ($SSID); Re-registering a non-global session that was interrupted above
Session_Start (); Re-open
Ob_end_clean (); Discard some header output just because of session_start
return $re;
}
http://www.bkjia.com/PHPjc/444858.html www.bkjia.com true http://www.bkjia.com/PHPjc/444858.html techarticle PHP Tutorial Imitate ASP Tutorial Application object Online Demographics Usage: application (' key ', ' value '),//set Key=value $value = Application (' key ');//Get Value of key */function AP ...