How to get and change URL variable PHP

前端 未结 7 1818
梦谈多话
梦谈多话 2020-12-29 23:24

Hi could anyone help me with this I have a URL like

parent/child/a=1&b=2$c=3

then I have a link that would add variable to that URL

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-30 00:06

    Try with the below expression, It Should Work

    preg_replace("#&d=.*&#", '&d=newvalue&', $_SERVER['REQUEST_URI'])
    

提交回复
热议问题