我正在尝试执行以下操作(我知道这似乎是不必要的复杂,但我不得不将问题分解成几个部分):
page_a.php
$keywords = get_meta_tags($_SERVER['HTTP_REFERER']);
$author = $keywords['author']; //"nameofauthor"
$foo = "foo";
$keywords = array ( "author" => $author, "foo" => $foo);
$_SESSION['keywords'] = $keywords;
//echo $author on page_a.php would successfully print "nameofauthor", so the variable isn't empty
page_b.php
echo $_SESSION['keywords']['author']; //echoes ""
echo $_SESSION['keywords']['foo']; //echoes "foo"
我错过了什么?
谢谢!