session_start();
function refresh(){
$_session['refresh'] = header('Refresh: 5, url=https://www.google.com);
}
我想在会话中存储标题功能如何存储
答案 0 :(得分:2)
尝试这样做:
function refresh() {
$_SESSION['refresh'] = array('rate'=>5, 'url'=>'https://www.google.com');
}
// Check if refresh session Exists
if( isset($_SESSION['refresh']) && count($_SESSION['refresh']) > 0 ) {
header("Refresh: ".$_SESSION['refresh']['rate'].";url=".$_SESSION['refresh']['url']."");
}
注意: ;
和url
之间没有空格