예제 #1
0
파일: Http.php 프로젝트: grithin/phpbase
 static function buildQuery($array)
 {
     $standard = array();
     foreach ($array as $k => $v) {
         //exclude standard array handling from php array handling
         if (is_array($v) && !preg_match('@\\[.*\\]$@', $k)) {
             $key = urlencode($k);
             foreach ($v as $v2) {
                 $standard[] = $key . '=' . urlencode($v2);
             }
             unset($array[$k]);
         }
     }
     $phpquery = http_build_query($array);
     $standard = implode('&', $standard);
     return Arrays::implode('&', array($phpquery, $standard));
 }