使用PHP - 如何在重定向中组合锚标记和GET变量

时间:2013-06-03 03:19:01

标签: php html get anchor

I want to combine these:

header("Location: index.php?msg=1");
header("Location: index.php#go-hear");


To look something like this:
header("Location: index.php#go-hear?msg=1");

这可能吗? 换句话说,我正在使用_GET并发送一个案例来过滤掉一个switch语句。 但我也希望页面使用锚标记重定向到页面底部,而不是顶部。

1 个答案:

答案 0 :(得分:3)

尝试header("Location: index.php?msg=1#go-hear");