本文整理汇总了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;
}
示例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;
}