本文整理汇总了PHP中complex_array::to_flat_array方法的典型用法代码示例。如果您正苦于以下问题:PHP complex_array::to_flat_array方法的具体用法?PHP complex_array::to_flat_array怎么用?PHP complex_array::to_flat_array使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类complex_array
的用法示例。
在下文中一共展示了complex_array::to_flat_array方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perform
function perform()
{
$object_data = fetch_mapped_by_url();
$parent_data = fetch_one_by_node_id($object_data['parent_node_id']);
$path = $parent_data['path'];
$params = complex_array :: array_merge($_GET, $_POST);
$sep = '';
$query = '';
$flat_params = array();
complex_array :: to_flat_array($params, $flat_params);
foreach ($flat_params as $key => $value)
{
$query .= $sep . $key . '=' . urlencode($value);
$sep = '&';
}
if (!empty($query))
$path .= '?' . $query;
return new redirect_response(RESPONSE_STATUS_SUCCESS, $path);
}
示例2: to_flat_array
function to_flat_array($array, &$result, $prefix = '')
{
foreach ($array as $key => $value) {
$string_key = $prefix ? '[' . $key . ']' : $key;
if (is_array($value)) {
complex_array::to_flat_array($value, $result, $prefix . $string_key);
} else {
$result[$prefix . $string_key] = $value;
}
}
}
示例3: to_string
function to_string()
{
$uri = $this->get_uri();
$uri->remove_query_items();
$result = array();
$query = '';
$exported = $this->export_attributes();
//removing files data
if (isset($exported['file'])) {
unset($exported['file']);
}
complex_array::to_flat_array($exported, $result);
foreach ($result as $key => $value) {
$query .= $key . '=' . $value . '&';
}
$query = utf8_rtrim($query, '&');
return utf8_rtrim($uri->to_string() . '?' . $query, '?');
}
示例4: array
/**
* Return the URI to a specific page in the list.
*
* @return string
* @access public
*/
function get_page_uri($page)
{
$params = complex_array :: array_merge($_GET, $_POST);
if ($page <= 1)
{
unset($params[$this->pager_variable.'_'. $this->get_server_id()]);
}
else
{
$params[$this->pager_variable .'_'. $this->get_server_id()] = $page;
}
$sep = '';
$query = '';
$flat_params = array();
complex_array :: to_flat_array($params, $flat_params);
foreach ($flat_params as $key => $value)
{
$query .= $sep . $key . '=' . urlencode($value);
$sep = '&';
}
if (empty($query))
{
return $this->base_url;
}
else
{
return $this->base_url . '?' . $query;
}
}
示例5: array
/**
* Returns flat query_string
*
*/
function get_query_string()
{
$query_string = '';
$query_items = array();
$flat_array = array();
complex_array :: to_flat_array($this->_query_items, $flat_array);
ksort($flat_array);
foreach($flat_array as $key => $value)
{
if ($value != '' || is_null($value))
$query_items[] = $key . '=' . $value;
else
$query_items[] = $key;
}
if($query_items)
$query_string = implode('&', $query_items);
return $query_string;
}
示例6: perform
function perform(&$request, &$response)
{
$object_data = fetch_requested_object();
$parent_data = fetch_one_by_node_id($object_data['parent_node_id']);
$path = $parent_data['path'];
$params = complex_array :: array_merge($_GET, $_POST);
$sep = '';
$query = '';
$flat_params = array();
complex_array :: to_flat_array($params, $flat_params);
foreach ($flat_params as $key => $value)
{
$query .= $sep . $key . '=' . urlencode($value);
$sep = '&';
}
if (!empty($query))
$path .= '?' . $query;
$response->redirect($path);
}