使用GET方法在header()函数中发送多个值

Mar*_*nda 4 php get header

我的问题是关于header()功能.我试图通过这个函数发送2个变量,如下所示:

header("Location:index.php?variable_1='true'&variable_2='false'");

我认为这是逃避的问题,&但我只是用&. Also, first variable gets initialized and I can acquire it by calling$ _GET ['variable_1']来尝试它,但是第二个没有存在且没有初始化.

所以我的问题是,我可以通过GET方法通过header()函数发送多个值吗?

感谢您的时间!

HiD*_*d3N 5

是的,你可以以防万一

header("Location: index.php?variable_1=true&variable_2=false");
Run Code Online (Sandbox Code Playgroud)

你不需要使用''这个