本文整理汇总了PHP中urldecode函数的典型用法代码示例。如果您正苦于以下问题:PHP urldecode函数的具体用法?PHP urldecode怎么用?PHP urldecode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了urldecode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLocation
function getLocation($str)
{
$array_size = intval(substr($str, 0, 1));
// 拆成的行数
$code = substr($str, 1);
// 加密后的串
$len = strlen($code);
$subline_size = $len % $array_size;
// 满字符的行数
$result = array();
$deurl = "";
for ($i = 0; $i < $array_size; $i += 1) {
if ($i < $subline_size) {
array_push($result, substr($code, 0, ceil($len / $array_size)));
$code = substr($code, ceil($len / $array_size));
} else {
array_push($result, substr($code, 0, ceil($len / $array_size) - 1));
$code = substr($code, ceil($len / $array_size) - 1);
}
}
for ($i = 0; $i < ceil($len / $array_size); $i += 1) {
for ($j = 0; $j < count($result); $j += 1) {
$deurl = $deurl . "" . substr($result[$j], $i, 1);
}
}
return str_replace("^", "0", urldecode($deurl));
}
示例2: getListQuery
/**
* Method to get a JDatabaseQuery object for retrieving the data set from a database.
*
* @return object A JDatabaseQuery object to retrieve the data set.
*/
protected function getListQuery()
{
$w = explode('|', urldecode(JRequest::getVar('filterStr', '')));
$user = JFactory::getUser();
$filterStr = $w[0];
$filterAktiv = $w[1];
if ($filterAktiv == 1) {
$lezartLimit = 1;
} else {
$lezartLimit = 99;
}
if ($filterStr != '') {
$filterStr = ' and sz.megnevezes like "%' . $filterStr . '%"';
}
$db = $this->getDbo();
$query = $db->getQuery(true);
$catid = (int) $this->getState('authorlist.id', 1);
$query = '
/* szavazások amik jelenleg vita1 állapotban vannak */
/* ================================================ */
SELECT sz.megnevezes, sz.vita1, sz.vita2, sz.szavazas, sz.lezart, sz.szavazas_vege, sz.titkos, sz.vita2_vege,
sz.id, sz.temakor_id
FROM #__szavazasok sz
WHERE (sz.vita2=1) ' . $filterStr;
$query .= ' order by ' . JRequest::getVar('order', '6');
return $query;
}
示例3: processStandardHeaders
/**
* Processes the standard headers that are not subdivided into other structs.
*/
protected function processStandardHeaders()
{
$req = $this->request;
$req->date = isset($_SERVER['REQUEST_TIME']) ? new DateTime("@{$_SERVER['REQUEST_TIME']}") : new DateTime();
if (isset($_SERVER['REQUEST_METHOD'])) {
switch ($_SERVER['REQUEST_METHOD']) {
case 'POST':
$req->protocol = 'http-post';
break;
case 'PUT':
$req->protocol = 'http-put';
break;
case 'DELETE':
$req->protocol = 'http-delete';
break;
default:
$req->protocol = 'http-get';
}
}
$req->host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost.localdomain');
$req->uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
// remove the query string from the URI
$req->uri = preg_replace('@\\?.*$@', '', $req->uri);
// url decode the uri
$req->uri = urldecode($req->uri);
// remove the prefix from the URI
$req->uri = preg_replace('@^' . preg_quote($this->properties['prefix']) . '@', '', $req->uri);
$req->requestId = $req->host . $req->uri;
$req->referrer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
$req->variables =& $_REQUEST;
if ($req->protocol == 'http-put') {
$req->body = file_get_contents("php://input");
}
}
示例4: replace
/**
* 替换屏蔽字
*/
public function replace()
{
$content = trim(urldecode($this->input['banword']));
$symbol = trim(urldecode($this->input['symbol']));
if (empty($content)) {
$this->errorOutput(OBJECT_NULL);
}
$data = $this->banword($content);
if ($data) {
$replace = array();
$find = array();
foreach ($data as $v) {
if (!empty($symbol) && $symbol != '*') {
$replace[] = $symbol;
} else {
if (!empty($v['banwd'])) {
$replace[] = $v['banwd'];
} else {
$replace[] = str_repeat('*', mb_strlen($v['banname'], 'utf-8'));
}
}
$find[] = $v['banname'];
}
$content = str_replace($find, $replace, $content);
}
$this->addItem($content);
$this->output();
}
示例5: _toHtml
protected function _toHtml()
{
$rssObj = Mage::getModel('rss/rss');
$route = Mage::helper('blog')->getRoute();
$url = $this->getUrl($route);
$title = Mage::getStoreConfig('blog/blog/title');
$data = array('title' => $title, 'description' => $title, 'link' => $url, 'charset' => 'UTF-8');
if (Mage::getStoreConfig('blog/rss/image') != "") {
$data['image'] = $this->getSkinUrl(Mage::getStoreConfig('blog/rss/image'));
}
$rssObj->_addHeader($data);
$collection = Mage::getModel('blog/blog')->getCollection()->addStoreFilter(Mage::app()->getStore()->getId())->setOrder('created_time ', 'desc');
$identifier = $this->getRequest()->getParam('identifier');
$tag = $this->getRequest()->getParam('tag');
if ($tag) {
$collection->addTagFilter(urldecode($tag));
}
if ($cat_id = Mage::getSingleton('blog/cat')->load($identifier)->getcatId()) {
Mage::getSingleton('blog/status')->addCatFilterToCollection($collection, $cat_id);
}
Mage::getSingleton('blog/status')->addEnabledFilterToCollection($collection);
$collection->setPageSize((int) Mage::getStoreConfig('blog/rss/posts'));
$collection->setCurPage(1);
if ($collection->getSize() > 0) {
foreach ($collection as $post) {
$data = array('title' => $post->getTitle(), 'link' => $this->getUrl($route . "/" . $post->getIdentifier()), 'description' => $post->getPostContent(), 'lastUpdate' => strtotime($post->getCreatedTime()));
$rssObj->_addEntry($data);
}
}
return $rssObj->createRssXml();
}
示例6: indexAction
/**
* Returns the initial HTML view for the admin interface.
*
* @param \Illuminate\Http\Request $request Laravel request object
* @return \Illuminate\Contracts\View\View View for rendering the output
*/
public function indexAction(Request $request)
{
if (config('shop.authorize', true)) {
$this->authorize('admin');
}
$site = Route::input('site', 'default');
$lang = Input::get('lang', config('app.locale', 'en'));
$aimeos = app('\\Aimeos\\Shop\\Base\\Aimeos')->get();
$cntlPaths = $aimeos->getCustomPaths('controller/extjs');
$context = app('\\Aimeos\\Shop\\Base\\Context')->get(false);
$context = $this->setLocale($context, $site, $lang);
$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
$cssFiles = array();
foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths) {
foreach ($paths as $path) {
$jsbAbsPath = $base . '/' . $path;
if (!is_file($jsbAbsPath)) {
throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath));
}
$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path));
$cssFiles = array_merge($cssFiles, $jsb2->getUrls('css'));
}
}
$jqadmUrl = route('aimeos_shop_jqadm_search', array('site' => $site, 'resource' => 'product'));
$jsonUrl = route('aimeos_shop_extadm_json', array('site' => $site, '_token' => csrf_token()));
$adminUrl = route('aimeos_shop_extadm', array('site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>'));
$vars = array('lang' => $lang, 'cssFiles' => $cssFiles, 'languages' => $this->getJsonLanguages($context), 'config' => $this->getJsonClientConfig($context), 'site' => $this->getJsonSiteItem($context, $site), 'i18nContent' => $this->getJsonClientI18n($aimeos->getI18nPaths(), $lang), 'searchSchemas' => $controller->getJsonSearchSchemas(), 'itemSchemas' => $controller->getJsonItemSchemas(), 'smd' => $controller->getJsonSmd($jsonUrl), 'urlTemplate' => str_replace(['<', '>'], ['{', '}'], urldecode($adminUrl)), 'uploaddir' => config('shop::uploaddir'), 'activeTab' => Input::get('tab', 0), 'version' => $this->getVersion(), 'jqadmurl' => $jqadmUrl);
return View::make('shop::admin.extadm-index', $vars);
}
示例7: swp_buffer_button_html
function swp_buffer_button_html($array)
{
// If we've already generated this button, just use our existing html
if (isset($_GLOBALS['sw']['buttons'][$array['postID']]['buffer'])) {
$array['resource']['buffer'] = $_GLOBALS['sw']['buttons'][$array['postID']]['buffer'];
// If not, let's check if Buffer is activated and create the button HTML
} elseif (isset($array['options']['newOrderOfIcons']['buffer']) && !isset($array['buttons']) || isset($array['buttons']) && isset($array['buttons']['buffer'])) {
// Collect the Title
$title = get_post_meta($array['postID'], 'nc_ogTitle', true);
if (!$title) {
$title = get_the_title();
}
$array['totes'] += $array['shares']['buffer'];
++$array['count'];
$array['resource']['buffer'] = '<div class="nc_tweetContainer swp_buffer" data-id="' . $array['count'] . '" data-network="buffer">';
$link = urlencode(urldecode(swp_process_url($array['url'], 'buffer', $array['postID'])));
$array['resource']['buffer'] .= '<a target="_blank" href="http://bufferapp.com/add?url=' . $link . '&text=' . urlencode(html_entity_decode($title, ENT_COMPAT, 'UTF-8')) . '" data-link="http://bufferapp.com/add?url=' . $link . '&text=' . urlencode(html_entity_decode($title, ENT_COMPAT, 'UTF-8')) . '" class="nc_tweet buffer_link">';
if ($array['options']['totesEach'] && $array['shares']['totes'] >= $array['options']['minTotes'] && $array['shares']['buffer'] > 0) {
$array['resource']['buffer'] .= '<span class="iconFiller">';
$array['resource']['buffer'] .= '<span class="spaceManWilly">';
$array['resource']['buffer'] .= '<i class="sw sw-buffer"></i>';
$array['resource']['buffer'] .= '<span class="swp_share"> ' . __('Buffer', 'social-warfare') . '</span>';
$array['resource']['buffer'] .= '</span></span>';
$array['resource']['buffer'] .= '<span class="swp_count">' . swp_kilomega($array['shares']['buffer']) . '</span>';
} else {
$array['resource']['buffer'] .= '<span class="swp_count swp_hide"><span class="iconFiller"><span class="spaceManWilly"><i class="sw sw-buffer"></i><span class="swp_share"> ' . __('Buffer', 'social-warfare') . '</span></span></span></span>';
}
$array['resource']['buffer'] .= '</a>';
$array['resource']['buffer'] .= '</div>';
// Store these buttons so that we don't have to generate them for each set
$_GLOBALS['sw']['buttons'][$array['postID']]['buffer'] = $array['resource']['buffer'];
}
return $array;
}
示例8: parse_quote_string
function parse_quote_string($query_string)
{
/* urldecode the string and setup variables */
$query_string = urldecode($query_string);
$quote_flag = false;
$word = '';
$terms = array();
/* loop through character by character and move terms to an array */
for ($i = 0; $i < strlen($query_string); $i++) {
$char = substr($query_string, $i, 1);
if ($char == '"') {
if ($quote_flag) {
$quote_flag = false;
} else {
$quote_flag = true;
}
}
if ($char == ' ' && !$quote_flag) {
$terms[] = $word;
$word = '';
} else {
if (!($char == '"')) {
$word .= $char;
}
}
}
$terms[] = $word;
/* return the fully parsed array */
return $terms;
}
示例9: buildContent
/**
* Build the content for this action
*
* @return boolean
* @access public
* @since 4/26/05
*/
function buildContent()
{
$actionRows = $this->getActionRows();
$harmoni = Harmoni::instance();
ob_start();
CollectionsPrinter::printFunctionLinks();
$layout = new Block(ob_get_contents(), STANDARD_BLOCK);
ob_end_clean();
$actionRows->add($layout, null, null, CENTER, CENTER);
$type = HarmoniType::fromString(urldecode(RequestContext::value('type')));
$repositoryManager = Services::getService("Repository");
// Get the Repositories
$allRepositories = $repositoryManager->getRepositoriesByType($type);
// put the repositories into an array and order them.
// @todo, do authorization checking
$repositoryArray = array();
while ($allRepositories->hasNext()) {
$repository = $allRepositories->next();
$repositoryArray[$repository->getDisplayName()] = $repository;
}
ksort($repositoryArray);
// print the Results
$resultPrinter = new ArrayResultPrinter($repositoryArray, 2, 20, "printrepositoryShort", $harmoni);
$resultPrinter->addLinksStyleProperty(new MarginTopSP("10px"));
$resultLayout = $resultPrinter->getLayout();
$actionRows->add($resultLayout, null, null, CENTER, CENTER);
}
示例10: filter
/**
* Detects all images in shortcode format and converts them into images, clickable links or raw URLs
*
* @param string $text HTML-encoded string
* @param boolean $imagesEnabled Whether to convert shortcodes into real images
* @param boolean $linksEnabled Whether to convert shortcodes into real hyperlinks
*
* @return string
*/
public function filter($text, $imagesEnabled, $linksEnabled = true)
{
if (preg_match_all(self::SHORTCODE_REGEXP, $text, $matches)) {
if (count($matches) < 3) {
return $text;
}
foreach ($matches[0] as $key => $shortCode) {
$imageSrc = $matches[2][$key];
$imageThumbnailSrc = $matches[3][$key];
$imageOrgSrc = $matches[4][$key];
$replace = '';
if ($imagesEnabled) {
$replace = sprintf(self::IMAGE_TAG_TEMPLATE, $imageSrc, $imageThumbnailSrc);
} else {
if ($linksEnabled) {
if ($imageOrgSrc == '_') {
$imageOrgSrc = $imageSrc;
}
$url = (!preg_match(self::URL_PROTOCOLS_REGEXP, $imageOrgSrc) ? 'http://' : '') . $imageOrgSrc;
$linkBody = htmlentities(urldecode($imageOrgSrc), ENT_QUOTES, 'UTF-8', false);
$replace = sprintf('<a href="%s" target="_blank" rel="nofollow">%s</a>', $url, $linkBody);
} else {
$replace = $imageOrgSrc != '_' ? $imageOrgSrc : $imageSrc;
}
}
$text = $this->strReplaceFirst($shortCode, $replace, $text);
}
}
return $text;
}
示例11: get
/**
* HTTP GET 请求
* @param string $url 请求地址
* @param array $data 请求数据
* @param null $cookie COOKIE
* @param null $cookiefile COOKIE 请求所用的COOKIE文件位置
* @param null $cookiesavepath 请求完成的COOKIE保存位置
* @param bool $encode 是否对请求参数进行 urlencode 处理
* @return mixed
* @throws Exception
*/
public static function get($url, $data = array(), $cookie = null, $cookiefile = null, $cookiesavepath = null, $encode = true)
{
//初始化句柄
$ch = curl_init();
//处理GET参数
if (count($data) > 0) {
$query = $encode ? http_build_query($data) : urldecode(http_build_query($data));
curl_setopt($ch, CURLOPT_URL, $url . '?' . $query);
} else {
curl_setopt($ch, CURLOPT_URL, $url);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36');
//设置cookie
if (isset($cookie)) {
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
}
//设置cookie请求文件
if (isset($cookiefile)) {
if (!is_file($cookiefile)) {
throw new Exception('Cookie文件不存在');
}
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
}
//设置cookie保存路径
if (isset($cookiesavepath)) {
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiesavepath);
}
//执行请求
$resp = curl_exec($ch);
//关闭句柄,释放资源
curl_close($ch);
return $resp;
}
示例12: beforeRender
/**
* beforeRender callback function
*
* @return array contents for panel
**/
public function beforeRender(Controller $controller)
{
$cacheKey = $controller->Toolbar->cacheKey;
$toolbarHistory = Cache::read($cacheKey, 'debug_kit');
$historyStates = array();
if (is_array($toolbarHistory) && !empty($toolbarHistory)) {
$prefix = array();
if (!empty($controller->request->params['prefix'])) {
$prefix[$controller->request->params['prefix']] = false;
}
foreach ($toolbarHistory as $i => $state) {
if (!isset($state['request']['content']['url'])) {
continue;
}
$title = $state['request']['content']['url'];
$query = @$state['request']['content']['query'];
if (isset($query['url'])) {
unset($query['url']);
}
if (!empty($query)) {
$title .= '?' . urldecode(http_build_query($query));
}
$historyStates[] = array('title' => $title, 'url' => array_merge($prefix, array('plugin' => 'debug_kit', 'controller' => 'toolbar_access', 'action' => 'history_state', $i + 1)));
}
}
if (count($historyStates) >= $this->history) {
array_pop($historyStates);
}
return $historyStates;
}
示例13: get_current_page
function get_current_page()
{
global $HTTP_GET_VARS, $HTTP_POST_VARS, $request_type;
$get_vars = array();
if (tep_not_null(REQUEST_URI)) {
if (strpos(REQUEST_URI, '?')) {
$current_page = PHP_SELF;
// if (substr($current_page, 0, strlen(DIR_WS_CATALOG))==DIR_WS_CATALOG) $current_page = substr($current_page, strlen(DIR_WS_CATALOG));
$qstring = substr(REQUEST_URI, strpos(REQUEST_URI, '?') + 1);
$qstring_array = explode('&', str_replace('&', '&', $qstring));
reset($qstring_array);
while (list(, $get_var) = each($qstring_array)) {
list($var_name, $var_value) = explode('=', $get_var);
if (!in_array($var_name, array('x', 'y'))) {
$get_vars[$var_name] = urldecode($var_value);
}
}
} else {
$current_page = REQUEST_URI;
$qstring = '';
}
} else {
$current_page = basename(SCRIPT_FILENAME);
$get_vars = $HTTP_GET_VARS;
}
if (!in_array(tep_session_name(), array_keys($get_vars))) {
$get_vars[tep_session_name()] = tep_session_id();
}
return array('page' => $current_page, 'mode' => $request_type, 'get' => $get_vars, 'post' => $HTTP_POST_VARS, 'real_page' => basename(SCRIPT_FILENAME), 'real_get' => $HTTP_GET_VARS);
}
示例14: display_each_ebook
function display_each_ebook($directory, $name)
{
$check_thumb = check_thumb_exists(urldecode($directory . $name));
echo '<td id = "thumbnail_container" width = "14%">
<img rel ="images" id = "' . $directory . $name . '" src = "' . \OCP\Util::linkTo('reader', 'ajax/thumbnail.php') . '&filepath=' . $directory . rtrim($name, 'pdf') . 'png' . '">
</td>';
echo '<td class = "filename svg" width = "86%">
<a class="name" href="http://localhost' . \OCP\Util::linkTo('files', 'download.php') . '?file=' . $directory . $name . '" title="' . urldecode($name) . '" dir ="' . $directory . $name . '" value = "' . $check_thumb . '">
<span class = "nametext">' . htmlspecialchars(urldecode($name)) . '</span>
</a>
<div id = "displaybox">';
$each_row = find_tags_for_ebook(urldecode($directory) . urldecode($name));
$tags = explode(",", $each_row);
$tag_count = 1;
foreach ($tags as $tag) {
if ($tag_count == 2) {
echo ", ";
}
echo '<a href = "' . \OCP\Util::linkTo('reader', 'fetch_tags.php') . '?tag=' . $tag . '">' . ucwords($tag) . '</a>';
$tag_count += 1;
}
echo '</div>
<input type="button" class="start" value="Add Tag">
<div id="contentbox" contenteditable="true"></div>
</td>';
}
示例15: buildRequestUrl
private function buildRequestUrl($apiName, $options = array(), $productId = '', $urls = array())
{
$data = array('domain' => 'http://gw.api.alibaba.com/openapi', 'format' => 'param2', 'version' => 2, 'namespace' => 'portals.open');
$hostname = implode('/', $data);
$endpoint = $apiName . '/' . API_KEY . '?' . urldecode(http_build_query($options));
return $requestUrl = $hostname . '/' . $endpoint;
}