Parse query string into an array

前端 未结 10 2392
暖寄归人
暖寄归人 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:27

    Use http://us1.php.net/parse_str

    Attention, it's usage is:

    parse_str($str, &$array);
    

    not

    $array = parse_str($str);
    

提交回复
热议问题