将任意 url 作为 $_GET 变量传递

发布于 2024-12-24 16:56:15 字数 329 浏览 5 评论 0原文

给定一些任意的 url:

view.php?viewid=blahblahblah

有没有一种方法可以对一个查询字符串进行编码,该查询字符串将上述 URL 作为变量并保留它的(view.php 的)查询字符串?

显然,对于某些 URL:

obvious.php?obvid=foobarzot&old_url=view.php?viewid=blahblahblah

根本不起作用,但是是否有一个 php 函数可以用来编码 view.php 以便我可以传递它?

干杯!

Given some arbitrary url:

view.php?viewid=blahblahblah

Is there a way I can encode a query string which has the above URL as a variable and preserves it's (view.php's) query string?

Obviously, for some URL:

obvious.php?obvid=foobarzot&old_url=view.php?viewid=blahblahblah

will not work at all, but is there a php function with which I could encode view.php so that I could pass it around?

Cheers!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

执手闯天涯 2024-12-31 16:56:15

urlencode 将 URL 添加到查询字符串之前。

urlencode the URL before adding it to the query string.

浅听莫相离 2024-12-31 16:56:15

我认为您正在寻找 urlencode()

I think you're looking for urlencode()

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文