从查询字符串第2部分中删除值 [英] Remove a value from a querystring Part 2
问题描述
扩展我的原始问题此处:我现在想删除
例如,我想删除变量 bar1
&来自查询字符串的 bar2
。我试过了下面的代码:
$ b $ pre $ echo $ parseQueryString(http://。$ _SERVER ['HTTP_HOST']。$ _SERVER [ 'REQUEST_URI'], BAR2, BAR1);
但是这并不会去除这两个变量,只有 谢谢, Matt 你会想要一些像 bar2 $ c
$ p
$ b
$ b
echo parseQueryString(parseQueryString(http://。$ _SERVER ['HTTP_HOST']。$ _SERVER ['REQUEST_URI'],bar2),bar1) ;
或者,因为我假设parseQueryString是您定义的函数,您可以更改它,一个数组参数并遍历数组。
Expanding on my original question here: I would now like to remove more than 1 variable from the querystring.
For example, I want to remove the variables bar1
& bar2
from the querystring. I have tried the following code:
echo parseQueryString("http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],"bar2","bar1");
But this doesn't remove both variables, only bar2
.
Any help appreciated.
Thank you,
Matt
You'll be wanting something like
echo parseQueryString(parseQueryString("http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],"bar2"),"bar1");
Alternatively, since I'm assuming parseQueryString is a function you defined, you can change it so it accepts an array argument and loops over the array.
这篇关于从查询字符串第2部分中删除值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!