Parse query string into an array

前端 未结 10 2368
暖寄归人
暖寄归人 2020-11-22 02:58

How can I turn a string below into an array?

pg_id=2&parent_id=2&document&video 

This is the

10条回答
  •  北海茫月
    2020-11-22 03:52

    This is one-liner for parsing query from current URL into array:

    parse_str($_SERVER['QUERY_STRING'], $query);
    

提交回复
热议问题