How to get and change URL variable PHP

前端 未结 7 1833
梦谈多话
梦谈多话 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条回答
  •  甜味超标
    2020-12-29 23:45

    $query = $_GET;
    // replace parameter(s)
    $query['d'] = 'new_value';
    // rebuild url
    $query_result = http_build_query($query);
    // new link
    Link
    

提交回复
热议问题