如何在php中循环获取请求

I have a get request like this

http://osxchange.org/displayname.php/?ids=0c313c95-f577-48ac-9175-9f2575684a31&ids=10cfcddb-8a9b-4811-af54-1166b76948fd&ids=1208792e-518f-4c38-94fb-9fc58c61965e&ids=2a2b44c2-12aa-45e6-b680-6534aa76e9d9&ids=2c02eaaa-4a87-4c92-b5d0-57c069d3fc3d&ids=3a47d3bb-2820-4719-a903-e1887e7f6723

How do i loop thru all the "ids" in the url. I need to loop thru the ids to look up data about them in mysql. The url may only contain 1 ids in the request or many it is not static amount of ids in the get request.

Use the following script. I hope you will get your desire result.

 <?php
    $query  = explode('&', $_SERVER['QUERY_STRING']);
    foreach( $query as $param )
    {
      list($name, $value) = explode('=', $param, 2);
      $ids[] = urldecode($value);
    }
    print_r($ids);

    ?>