一个变量的两个动作PHP

Fél*_*ins 2 php variables

我想对一个变量执行两个操作,这是变量;

Header:('Location:http://localhost/portailinx/inscriptioncarosou.php')
unset($_SESSION['fb_token'])
Run Code Online (Sandbox Code Playgroud)

我尝试这样:

$next = Header:('Location:http://localhost/portailinx/inscriptioncarosou.php') && unset($_SESSION['fb_token']);
Run Code Online (Sandbox Code Playgroud)

但不起作用。

不是一种形式,它只是一个简单的变量 facebookhelper->getLogoutURL

Sim*_*gro 5

首先,unset然后重定向用户,例如:

// it is good practice to check that something is set before unset
if(isset($_SESSION['fb_token'])) unset($_SESSION['fb_token']);

// after unset can redirect the user
header('Location:http://localhost/portailinx/inscriptioncarosou.php');

// end the script run
exit;
Run Code Online (Sandbox Code Playgroud)