替换URI查询字符串中的值 [英] Replace values in a URI query string

查看:161
本文介绍了替换URI查询字符串中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一部分要替换的查询字符串.我想使用preg_replace,但有点挂在正则表达式上.

I have part of a query string that I want to make a replacement in. I want to use preg_replace but am kind of hung up on the regex.

有人可以帮忙吗?我需要替换的是GET变量.

Can someone please help? What I need replaced are the GET vars.

这是字符串:

bikeType=G&nikeNumber=4351

推荐答案

PHP具有解析查询字符串的便捷功能:

PHP has a convenient function to parse query strings: parse_str(). You might want to take a look at that or provide more details as your question isn't exactly clear.

这篇关于替换URI查询字符串中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆