当前位置: 首页>>代码示例>>PHP>>正文


PHP Net_URL::_parseRawQuerystring方法代码示例

本文整理汇总了PHP中Net_URL::_parseRawQuerystring方法的典型用法代码示例。如果您正苦于以下问题:PHP Net_URL::_parseRawQuerystring方法的具体用法?PHP Net_URL::_parseRawQuerystring怎么用?PHP Net_URL::_parseRawQuerystring使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Net_URL的用法示例。


在下文中一共展示了Net_URL::_parseRawQuerystring方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: meldPersistQuery

 function meldPersistQuery($sQuery = "", $event = "", $asArray = false)
 {
     if (is_array($sQuery)) {
         $aQuery = $sQuery;
     } else {
         if (!empty($sQuery)) {
             // need an intermediate step here.
             $aQuery = Net_URL::_parseRawQuerystring($sQuery);
         } else {
             $aQuery = array();
         }
     }
     // now try to grab each persisted entry
     // don't overwrite the existing values, if added.
     if (is_array($this->aPersistParams)) {
         foreach ($this->aPersistParams as $k) {
             if (!array_key_exists($k, $aQuery)) {
                 $v = KTUtil::arrayGet($_REQUEST, $k);
                 if (!empty($v)) {
                     $aQuery[$k] = $v;
                 }
             }
             // handle the case where action is passed in already.
         }
     }
     // if it isn't already set
     if (!array_key_exists($this->event_var, $aQuery) && !empty($event)) {
         $aQuery[$this->event_var] = urlencode($event);
     }
     //var_dump($aQuery);
     if ($asArray) {
         return $aQuery;
     }
     // encode and blend.
     $aQueryStrings = array();
     foreach ($aQuery as $k => $v) {
         $aQueryStrings[] = urlencode($k) . "=" . urlencode($v);
     }
     $sQuery = join('&', $aQueryStrings);
     return $sQuery;
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:41,代码来源:dispatcher.inc.php

示例2: array

 /**
  * レスポンス変換.
  *
  * @param curl_handler $curl
  * @return string
  */
 static function curl_result($curl)
 {
     $result = curl_exec($curl);
     $curl_info = curl_getinfo($curl);
     $status_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
     if ($status_code >= 400) {
         GC_Utils_Ex::gfPrintLog(print_r(compact("result"), true), DEBUG_LOG_REALFILE);
         SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "サービス停止中です。(E0003)");
     }
     $header_size = $curl_info["header_size"];
     $result = array("head" => trim(substr($result, 0, $header_size)), "body" => trim(substr($result, $header_size)), "info" => $curl_info, "get" => $_GET, "post" => $_POST);
     $result["info"]["request_header"] = preg_split("/[\r\n]+/", $result["info"]["request_header"]);
     array_filter($result["info"]["request_header"], "strlen");
     array_walk($result["info"]["request_header"], function ($value, $key) use(&$result) {
         if ($key == 0 || !is_numeric($key)) {
             return $value;
         }
         list($k, $v) = explode(":", $value, 2);
         $k = trim($k);
         if (strtolower($k) == "date") {
             $v = date("Y-m-d H:i:s T", strtotime($v));
         }
         $result["info"]["request_header"][$k] = trim($v);
         unset($result["info"]["request_header"][$key]);
     });
     $result["head_orig"] = $result["head"];
     $result["head"] = preg_split("/[\r\n]+/", $result["head"]);
     array_filter($result["head"], "strlen");
     array_walk($result["head"], function ($value, $key) use(&$result) {
         if ($key == 0 || !is_numeric($key)) {
             return $value;
         }
         list($k, $v) = explode(":", $value, 2);
         $k = trim($k);
         if (strtolower($k) == "date") {
             $v = date("Y-m-d H:i:s T", strtotime($v));
         }
         $result["head"][$k] = trim($v);
         unset($result["head"][$key]);
     });
     $result["body_orig"] = $result["body"];
     if (preg_match("(body|xml|html)", $result["body"])) {
         // nop
     } else {
         $result["body"] = preg_split("/[\r\n]+/", $result["body"]);
         array_filter($result["body"], "strlen");
         array_walk($result["body"], function ($value, $key) use(&$result) {
             if (!is_numeric($key)) {
                 return $value;
             }
             $newUrl = new Net_URL();
             $rows = $newUrl->_parseRawQuerystring($value);
             foreach ($rows as $k => $v) {
                 $result["body"][$k] = trim($v);
             }
             unset($result["body"][$key]);
         });
     }
     return $result;
 }
开发者ID:alice-asahina,项目名称:kisekae_touch,代码行数:66,代码来源:SC_AuonePayment_Ex.php


注:本文中的Net_URL::_parseRawQuerystring方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。