• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP mb_strpos函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中mb_strpos函数的典型用法代码示例。如果您正苦于以下问题:PHP mb_strpos函数的具体用法?PHP mb_strpos怎么用?PHP mb_strpos使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: cleanup

 protected function cleanup()
 {
     parent::cleanup();
     $start = mb_strpos($this->data, $this->partToken) + mb_strlen($this->partToken);
     $end = mb_strrpos($this->data, $this->partToken);
     $this->data = mb_substr($this->data, $start, $end - $start);
 }
开发者ID:rande,项目名称:sfSolrPlugin,代码行数:7,代码来源:sfLuceneHighlighterHTMLPart.class.php


示例2: save_get_and_exit_reload

 /**
  * Définir un cookie avec le contenu de paramètres transmis en GET puis rappeler la page
  * 
  * @param string $query_string   éventuellement avec 'url_redirection' en dernier paramètre
  * @return void
  */
 public static function save_get_and_exit_reload( $query_string )
 {
   Cookie::definir( COOKIE_MEMOGET , $query_string , 300 /* 60*5 = 5 min */ );
   $param_redir_pos = mb_strpos($query_string,'&url_redirection');
   $param_sans_redir = ($param_redir_pos) ? mb_substr( $query_string , 0 , $param_redir_pos ) : $query_string ; // J'ai déjà eu un msg d'erreur car il n'aime pas les chaines trop longues + Pas la peine d'encombrer avec le paramètre de redirection qui sera retrouvé dans le cookie de toutes façons
   exit_redirection(URL_BASE.$_SERVER['SCRIPT_NAME'].'?'.$param_sans_redir);
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:13,代码来源:class.Cookie.php


示例3: f_banners

function f_banners(&$text)
{
    $phrase = 'БАННЕР';
    if (mb_strpos($text, $phrase) === false) {
        return true;
    }
    if (!cmsCore::getInstance()->isComponentEnable('banners')) {
        return true;
    }
    $regex = '/{(' . $phrase . '=)\\s*(.*?)}/i';
    $matches = array();
    preg_match_all($regex, $text, $matches, PREG_SET_ORDER);
    if (!$matches) {
        return true;
    }
    cmsCore::loadModel('banners');
    foreach ($matches as $elm) {
        $elm[0] = str_replace('{', '', $elm[0]);
        $elm[0] = str_replace('}', '', $elm[0]);
        mb_parse_str($elm[0], $args);
        $position = @$args[$phrase];
        if ($position) {
            $output = cms_model_banners::getBannerHTML($position);
        } else {
            $output = '';
        }
        $text = str_replace('{' . $phrase . '=' . $position . '}', $output, $text);
    }
    return true;
}
开发者ID:vicktorwork,项目名称:cms1,代码行数:30,代码来源:filter.php


示例4: getOptions

 /**
  * Get plugin options.
  *
  * @since 151002 Improving multisite compat.
  *
  * @param bool  $intersect Discard options not present in $this->default_options
  * @param bool  $refresh   Force-pull options directly from get_site_option()
  *
  * @return array Plugin options.
  *
  * @note $intersect should be `false` when this method is called via a VS upgrade routine or during inital startup on when upgrading. See https://git.io/viGIK
  */
 public function getOptions($intersect = true, $refresh = false)
 {
     if (!($options = $this->options) || $refresh) {
         // If not defined yet, or if we're forcing a refresh via get_site_option()
         if (!is_array($options = get_site_option(GLOBAL_NS . '_options'))) {
             $options = [];
             // Force array.
         }
         if (!$options && is_array($zencache_options = get_site_option('zencache_options'))) {
             $options = $zencache_options;
             // Old ZenCache options.
             $options['crons_setup'] = $this->default_options['crons_setup'];
             $options['latest_lite_version'] = $this->default_options['latest_lite_version'];
             $options['latest_pro_version'] = $this->default_options['latest_pro_version'];
         }
     }
     $this->options = array_merge($this->default_options, $options);
     $this->options = $this->applyWpFilters(GLOBAL_NS . '_options', $this->options);
     $this->options = $intersect ? array_intersect_key($this->options, $this->default_options) : $this->options;
     foreach ($this->options as $_key => &$_value) {
         $_value = trim((string) $_value);
         // Force strings.
     }
     unset($_key, $_value);
     // Housekeeping.
     $this->options['base_dir'] = trim($this->options['base_dir'], '\\/' . " \t\n\r\v");
     if (!$this->options['base_dir'] || mb_strpos(basename($this->options['base_dir']), 'wp-') === 0) {
         $this->options['base_dir'] = $this->default_options['base_dir'];
     }
     return $this->options;
     // Plugin options.
 }
开发者ID:arobbins,项目名称:sblog,代码行数:44,代码来源:OptionUtils.php


示例5: f_includes

	function f_includes(&$text){

        $phrase = 'ФАЙЛ';

		if (mb_strpos($text, $phrase) === false){
			return true;
		}

 		$regex = '/{('.$phrase.'=)\s*(.*?)}/i';
		$matches = array();
		preg_match_all( $regex, $text, $matches, PREG_SET_ORDER );
		foreach ($matches as $elm) {
			$elm[0] = str_replace('{', '', $elm[0]);
			$elm[0] = str_replace('}', '', $elm[0]);
			mb_parse_str( $elm[0], $args );
			$file=@$args[$phrase];
			if ($file){
				$output = getLink($file);
			} else { $output = ''; }
			$text = str_replace('{'.$phrase.'='.$file.'}', $output, $text );
		}

		return true;

	}
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:25,代码来源:filter.php


示例6: utf8_strpos

/**
* Assumes mbstring internal encoding is set to UTF-8
* Wrapper around mb_strpos
* Find position of first occurrence of a string
* @param string haystack
* @param string needle (you should validate this with utf8_is_valid)
* @param integer offset in characters (from left)
* @return mixed integer position or FALSE on failure
* @package utf8
* @subpackage strings
*/
function utf8_strpos($str, $search, $offset = FALSE){
    if ( $offset === FALSE ) {
        return mb_strpos($str, $search);
    } else {
        return mb_strpos($str, $search, $offset);
    }
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:18,代码来源:core.php


示例7: validateIdentical

 protected function validateIdentical($input)
 {
     if (is_array($input)) {
         return reset($input) === $this->startValue;
     }
     return 0 === mb_strpos($input, $this->startValue, 0, mb_detect_encoding($input));
 }
开发者ID:rafaelgandi,项目名称:wasabi_artisan,代码行数:7,代码来源:StartsWith.php


示例8: load

 /** Last inn siden (kalles til slutten av scriptet for å hente themet */
 public function load()
 {
     $this->content .= ob_get_contents();
     @ob_clean();
     // load through twig template?
     $templates = array('guest_simple' => 'templates/guest/simple', 'guest' => 'templates/guest/wide', 'node' => 'templates/guest/node', 'doc' => 'templates/doc');
     if (isset($templates[$this->theme_file])) {
         $template = $templates[$this->theme_file];
         \Kofradia\View::forgeTwig($template);
         $response = new \Kofradia\Response();
         $response->setContents(\Kofradia\View::forgeTwig($template));
         $response->output();
         die;
     }
     global $_base;
     $_base->dt("page_load_pre");
     // temafilen
     $theme_file = PATH_PUBLIC . "/themes/" . $this->theme . "/" . $this->theme_file . ".php";
     // finnes ikke temafilen?
     if (!file_exists($theme_file)) {
         throw new HSException("Fant ikke temafilen <b>{$this->theme_file}.php</b> for temaet <b>{$this->theme}</b>.");
     }
     if (mb_strpos($this->content, '<boxes />') === false) {
         $this->content = '<boxes />' . $this->content;
     }
     // hent temafilen
     require $theme_file;
     // hent full html kode som ble generert
     $content = ob_get_contents();
     @ob_clean();
     echo $this->postParse($content);
     die;
 }
开发者ID:Kuzat,项目名称:kofradia,代码行数:34,代码来源:class.page.php


示例9: smarty_function_eF_template_printMessageBlock

/**
* prints a block
*
*/
function smarty_function_eF_template_printMessageBlock($params, &$smarty)
{
    !isset($params['type']) || !$params['type'] ? $params['type'] = 'failure' : null;
    in_array($params['type'], array('success', 'failure')) or $params['type'] = 'failure';
    if ($params['type'] == 'success') {
        $messageImage = '<img src = "images/32x32/success.png" alt = "' . _SUCCESS . '" title = "' . _SUCCESS . '">';
    } else {
        $messageImage = '<img src = "images/32x32/warning.png" alt = "' . _FAILURE . '" title = "' . _FAILURE . '">';
    }
    $link = mb_substr($params['content'], mb_strpos($params['content'], ' &nbsp;<a href = "javascript:void(0)" onclick = "eF_js_showDivPopup(event, \'' . _ERRORDETAILS . '\', 2, \'error_details\')">' . _MOREINFO . '</a>'));
    $message = mb_substr($params['content'], 0, mb_strpos($params['content'], ' &nbsp;<a href = "javascript:void(0)" onclick = "eF_js_showDivPopup(event, \'' . _ERRORDETAILS . '\', 2, \'error_details\')">' . _MOREINFO . '</a>'));
    $params['content'] = strip_tags($message) . $link;
    if (mb_strlen($params['content']) > 1000) {
        $prefix = mb_substr($params['content'], 0, 1000);
        $suffix = mb_substr($params['content'], mb_strlen($params['content']) - 300, mb_strlen($params['content']));
        $infix = mb_substr($params['content'], 1001, mb_strlen($params['content']) - mb_strlen($prefix) - mb_strlen($suffix));
        $params['content'] = $prefix . '<a href = "javascript:void(0)" onclick = "this.style.display = \'none\';Element.extend(this).next().show()"><br>[...]<br></a><span style = "display:none">' . $infix . '</span>' . $suffix;
    }
    $str .= '
        <div class = "block" id = "messageBlock">
        <div class = "blockContents messageContents">
        	<table class = "messageBlock">
            	<tr><td>' . $messageImage . '</td>
            		<td class = "' . strip_tags($params['type']) . 'Block">' . $params['content'] . '</td>
            		<td><img src = "images/32x32/close.png" alt = "' . _CLOSE . '" title = "' . _CLOSE . '" onclick = "window.Effect ? new Effect.Fade($(\'messageBlock\')) : document.getElementById(\'messageBlock\').style.display = \'none\';"></td></tr>
            </table>
        </div>
        </div>';
    return $str;
}
开发者ID:bqq1986,项目名称:efront,代码行数:34,代码来源:function.eF_template_printMessageBlock.php


示例10: _renderFilters

 protected function _renderFilters()
 {
     /* @var $core Mana_Core_Helper_Data */
     $core = Mage::helper(strtolower('Mana_Core'));
     $items = array();
     foreach ($this->_items as $key => $item) {
         $conforms = true;
         foreach ($this->_mFilters as $filter) {
             if ($filter['attribute'] == 'entity_type_id') {
                 continue;
             }
             $method = 'get' . $core->pascalCased($filter['attribute']);
             $value = $item->{$method}();
             if (isset($filter['condition']['like'])) {
                 $value = mb_convert_case($value, MB_CASE_UPPER, "UTF-8");
                 $test = mb_convert_case($filter['condition']['like'], MB_CASE_UPPER, "UTF-8");
                 if (mb_strpos($value, mb_substr($test, 1, mb_strlen($test) - 2)) === false) {
                     $conforms = false;
                     break;
                 }
             } elseif (isset($filter['condition']['eq'])) {
                 $test = $filter['condition']['eq'];
                 if ($value != $test) {
                     $conforms = false;
                     break;
                 }
             }
         }
         if ($conforms) {
             $items[$key] = $item;
         }
     }
     $this->_items = $items;
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:cupboardglasspipes.ecomitize.com,代码行数:35,代码来源:Derived.php


示例11: getConfigFile

 /**
  * Creates config file
  *
  * @param ConfigFile $cf Config file instance
  *
  * @return string
  */
 public static function getConfigFile(ConfigFile $cf)
 {
     $crlf = isset($_SESSION['eol']) && $_SESSION['eol'] == 'win' ? "\r\n" : "\n";
     $conf = $cf->getConfig();
     // header
     $ret = '<?php' . $crlf . '/*' . $crlf . ' * Generated configuration file' . $crlf . ' * Generated by: phpMyAdmin ' . $GLOBALS['PMA_Config']->get('PMA_VERSION') . ' setup script' . $crlf . ' * Date: ' . date(DATE_RFC1123) . $crlf . ' */' . $crlf . $crlf;
     //servers
     if (!empty($conf['Servers'])) {
         $ret .= self::getServerPart($cf, $crlf, $conf['Servers']);
         unset($conf['Servers']);
     }
     // other settings
     $persistKeys = $cf->getPersistKeysMap();
     foreach ($conf as $k => $v) {
         $k = preg_replace('/[^A-Za-z0-9_]/', '_', $k);
         $ret .= self::_getVarExport($k, $v, $crlf);
         if (isset($persistKeys[$k])) {
             unset($persistKeys[$k]);
         }
     }
     // keep 1d array keys which are present in $persist_keys (config.values.php)
     foreach (array_keys($persistKeys) as $k) {
         if (mb_strpos($k, '/') === false) {
             $k = preg_replace('/[^A-Za-z0-9_]/', '_', $k);
             $ret .= self::_getVarExport($k, $cf->getDefault($k), $crlf);
         }
     }
     $ret .= '?' . '>';
     return $ret;
 }
开发者ID:hewenhao2008,项目名称:phpmyadmin,代码行数:37,代码来源:ConfigGenerator.class.php


示例12: getSchemeHTML

 public function getSchemeHTML()
 {
     $template = cmsTemplate::getInstance();
     $scheme_html = $template->getSchemeHTML();
     if (!$scheme_html) {
         return false;
     }
     if (!preg_match_all('/{([a-zA-Z0-9:_\\-]+)}/u', $scheme_html, $matches)) {
         return false;
     }
     $blocks = $matches[1];
     foreach ($blocks as $block) {
         list($type, $value) = explode(':', $block);
         if ($type == 'position') {
             $replace_html = '<ul class="position" rel="' . $value . '" id="pos-' . $value . '"></ul>';
         }
         if ($type == 'block') {
             if (mb_strpos($value, 'LANG_') === 0) {
                 $value = constant($value);
             }
             $replace_html = '<div class="block"><span>' . $value . '</span></div>';
         }
         if ($type == 'cell') {
             if (mb_strpos($value, 'LANG_') === 0) {
                 $value = constant($value);
             }
             $replace_html = '<div class="cell"><span>' . $value . '</span></div>';
         }
         $scheme_html = str_replace("{{$block}}", $replace_html, $scheme_html);
     }
     return $scheme_html;
 }
开发者ID:asphix,项目名称:icms2,代码行数:32,代码来源:widgets.php


示例13: strpos

 private function strpos($haystack, $needle, $offset = 0)
 {
     #		echo "n: ->$needle<-, o: $offset len: ".strlen($haystack)." mblen: ".mb_strlen($haystack, mb_detect_encoding($haystack));
     #		echo " enc: ".mb_detect_encoding($haystack)."\n";
     #		echo "hs: $haystack, n: $needle, o: $offset\n";
     return mb_strpos($haystack, $needle, $offset, mb_detect_encoding($haystack));
 }
开发者ID:Shulyakovskiy,项目名称:dvijok,代码行数:7,代码来源:dvrpcproto.php


示例14: set

 /**
  * Сохраняем сообщение об ошибке
  * @return Errors объект
  */
 function set($errCodeName, $sErrorKey = null, $bSuccessfull = false, $sParam1 = null, $sParam2 = null, $sParam3 = null)
 {
     if ($errCodeName == 1) {
         $this->sm->assign('errno', 1);
     }
     if ($bSuccessfull) {
         $this->isSuccessfull = true;
     }
     if (is_string($errCodeName) && mb_strpos($errCodeName, ':') !== FALSE) {
         list($type, $param) = explode(':', $errCodeName);
         if (isset($this->lang['err_' . $type])) {
             $sMessage = $this->lang['err_' . $type];
             $sParam1 = '<b>' . mb_strtolower($this->getMessage($param)) . '</b>';
         } else {
             $sMessage = $this->getMessage($errCodeName);
         }
     } else {
         $sMessage = $this->getMessage($errCodeName);
     }
     $sMessage = str_replace(array('##$1##', '##$2##', '##$3##'), array($sParam1, $sParam2, $sParam3), $sMessage);
     if (isset($sErrorKey)) {
         $this->aErrors[$sErrorKey] = array('successfull' => $bSuccessfull, 'errno' => $errCodeName, 'msg' => $sMessage);
     } else {
         $this->aErrors[] = array('successfull' => $bSuccessfull, 'errno' => $errCodeName, 'msg' => $sMessage);
     }
     return $this;
 }
开发者ID:Sywooch,项目名称:dobox,代码行数:31,代码来源:errors.php


示例15: _includeFiles

 /**
  * Returns HTML code to include javascript file.
  *
  * @param array $files The list of js file to include
  *
  * @return string HTML code for javascript inclusion.
  */
 private function _includeFiles($files)
 {
     $first_dynamic_scripts = "";
     $dynamic_scripts = "";
     $scripts = array();
     foreach ($files as $value) {
         if (mb_strpos($value['filename'], "?") !== false) {
             if ($value['before_statics'] === true) {
                 $first_dynamic_scripts .= "<script type='text/javascript' src='js/" . $value['filename'] . "'></script>";
             } else {
                 $dynamic_scripts .= "<script type='text/javascript' src='js/" . $value['filename'] . "'></script>";
             }
             continue;
         }
         $include = true;
         if ($value['conditional_ie'] !== false && PMA_USR_BROWSER_AGENT === 'IE') {
             if ($value['conditional_ie'] === true) {
                 $include = true;
             } else {
                 if ($value['conditional_ie'] == PMA_USR_BROWSER_VER) {
                     $include = true;
                 } else {
                     $include = false;
                 }
             }
         }
         if ($include) {
             $scripts[] = "scripts[]=" . $value['filename'];
         }
     }
     $separator = PMA_URL_getArgSeparator();
     $url = 'js/get_scripts.js.php' . PMA_URL_getCommon(array(), 'none') . $separator . implode($separator, $scripts);
     $static_scripts = sprintf('<script type="text/javascript" src="%s"></script>', htmlspecialchars($url));
     return $first_dynamic_scripts . $static_scripts . $dynamic_scripts;
 }
开发者ID:harryboulderdash,项目名称:PlayGFC,代码行数:42,代码来源:Scripts.class.php


示例16: doSplitName

function doSplitName($name)
{
    $results = array();
    $r = explode(' ', $name);
    $size = count($r);
    if (mb_strpos($r[0], '.') === false) {
        $results['salutation'] = '';
        $results['first'] = $r[0];
    } else {
        $results['salutation'] = $r[0];
        $results['first'] = $r[1];
    }
    if (mb_strpos($r[$size - 1], '.') === false) {
        $results['suffix'] = '';
    } else {
        $results['suffix'] = $r[$size - 1];
    }
    $start = $results['salutation'] ? 2 : 1;
    $end = $results['suffix'] ? $size - 2 : $size - 1;
    $last = '';
    for ($i = $start; $i <= $end; $i++) {
        $last .= ' ' . $r[$i];
    }
    $results['last'] = trim($last);
    return $results;
}
开发者ID:ksingh812,项目名称:thub-old,代码行数:26,代码来源:export-csv.php


示例17: theme_strpos

function theme_strpos($source, $target)
{
    if (function_exists('mb_strpos')) {
        return mb_strpos($source, $target);
    }
    return strpos($source, $target);
}
开发者ID:slavam,项目名称:adult-childhood,代码行数:7,代码来源:misc.php


示例18: initValidator

 protected function initValidator()
 {
     $class = $this->getValidatorClass();
     if ($class) {
         $validator = new $class();
         $this->validator_messages = $validator->messages();
         $this->validator_rules = $validator->rules();
         foreach ($this->validator_rules as $element_name => $element_rules) {
             if (false !== mb_strpos($element_name, '.')) {
                 $element_name = str_replace('.', '][', $element_name) . ']';
                 $e = explode(']', $element_name, 2);
                 $element_name = implode('', $e);
             }
             foreach ($this->getElementsByName($element_name) as $el) {
                 $element_rules = explode('|', $element_rules);
                 foreach ($element_rules as $rule) {
                     $_rule = explode(':', $rule);
                     $rule_name = Arr::get($_rule, 0);
                     $rule_params = Arr::get($_rule, 1);
                     $rule_params = explode(',', $rule_params);
                     $method = Str::camel('rule_' . $rule_name);
                     if (method_exists($el, $method)) {
                         call_user_func_array([$el, $method], $rule_params);
                     }
                 }
             }
         }
     }
     return $this;
 }
开发者ID:larakit,项目名称:lk,代码行数:30,代码来源:LaraForm.php


示例19: loadSerializationPolicy

 private static function loadSerializationPolicy($moduleBaseURL, $strongName)
 {
     // The request can tell you the path of the web app relative to the
     // container root
     $contextPath = parse_url($_SERVER['SCRIPT_NAME'], PHP_URL_PATH);
     if (!is_null($moduleBaseURL)) {
         $modulePath = parse_url($moduleBaseURL, PHP_URL_PATH);
     }
     /*
      * Check that the module path must be in the same web app as the servlet
      * itself. If you need to implement a scheme different than this, override
      * this method.
      */
     if (empty($modulePath) || mb_strpos($modulePath, $contextPath) != 0) {
         $message = 'ERROR: The module path requested, ' . $modulePath . ', is not in the same web application as this servlet, ' . $contextPath . '. Your module may not be properly configured or your client and server code maybe out of date.';
         echo $message;
     } else {
         // Strip off the context path from module base URL. It should be
         // strict prefix
         //$contextRelativePath = mb_substr($modulePath, mb_strlen($contextPath));
         $contextRelativePath = GWT::getModuleBasePath();
         $serializationPolicyFilePath = SerializationPolicyLoader::getSerializationPolicyFileName($contextRelativePath . $strongName);
         // Open the RPC resource file and read its content
         try {
             $serializationPolicy = SerializationPolicyLoader::loadFromFile($serializationPolicyFilePath);
         } catch (ParseException $e) {
             echo "ERROR: Failed to parse the policy file '{$serializationPolicyFilePath}'", $e;
         }
         return $serializationPolicy;
     }
 }
开发者ID:google-code-backups,项目名称:gwtphp-derpc,代码行数:31,代码来源:RemoteServiceServlet.php


示例20: detectContext

 private static function detectContext()
 {
     if (self::$context !== null) {
         return;
     }
     if (defined('OW_USE_CONTEXT')) {
         switch (true) {
             case OW_USE_CONTEXT == 1:
                 self::$context = self::CONTEXT_DESKTOP;
                 return;
             case OW_USE_CONTEXT == 1 << 1:
                 self::$context = self::CONTEXT_MOBILE;
                 return;
             case OW_USE_CONTEXT == 1 << 2:
                 self::$context = self::CONTEXT_API;
                 return;
         }
     }
     $context = self::CONTEXT_DESKTOP;
     try {
         $isSmart = UTIL_Browser::isSmartphone();
     } catch (Exception $e) {
         return;
     }
     if (defined('OW_CRON')) {
         $context = self::CONTEXT_DESKTOP;
     } else {
         if (self::getSession()->isKeySet(OW_Application::CONTEXT_NAME)) {
             $context = self::getSession()->get(OW_Application::CONTEXT_NAME);
         } else {
             if ($isSmart) {
                 $context = self::CONTEXT_MOBILE;
             }
         }
     }
     if (defined('OW_USE_CONTEXT')) {
         if ((OW_USE_CONTEXT & 1 << 1) == 0 && $context == self::CONTEXT_MOBILE) {
             $context = self::CONTEXT_DESKTOP;
         }
         if ((OW_USE_CONTEXT & 1 << 2) == 0 && $context == self::CONTEXT_API) {
             $context = self::CONTEXT_DESKTOP;
         }
     }
     if ((bool) OW::getConfig()->getValue('base', 'disable_mobile_context') && $context == self::CONTEXT_MOBILE) {
         $context = self::CONTEXT_DESKTOP;
     }
     //temp API context detection
     //TODO remake
     $uri = UTIL_Url::getRealRequestUri(OW::getRouter()->getBaseUrl(), $_SERVER['REQUEST_URI']);
     if (mb_strstr($uri, '/')) {
         if (trim(mb_substr($uri, 0, mb_strpos($uri, '/'))) == 'api') {
             $context = self::CONTEXT_API;
         }
     } else {
         if (trim($uri) == 'api') {
             $context = self::CONTEXT_API;
         }
     }
     self::$context = $context;
 }
开发者ID:hardikamutech,项目名称:hammu,代码行数:60,代码来源:ow.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mb_strrchr函数代码示例发布时间:2022-05-15
下一篇:
PHP mb_strlen函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap