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


PHP _strtoupper函数代码示例

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


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

示例1: test_cases

 public function test_cases()
 {
     $sentence = 'пользователь должен быть у Вас в друзьях а Вы у него';
     $this->assertEquals('ПОЛЬЗОВАТЕЛЬ ДОЛЖЕН БЫТЬ У ВАС В ДРУЗЬЯХ А ВЫ У НЕГО', trim(_strtoupper($sentence)));
     $this->assertEquals('пользователь должен быть у вас в друзьях а вы у него', trim(_strtolower($sentence)));
     $this->assertNotEquals(strtoupper($sentence), _strtoupper($sentence));
     $this->assertNotEquals(strtolower($sentence), _strtolower($sentence));
     $this->assertNotEquals(ucfirst($sentence), _ucfirst($sentence));
     $this->assertNotEquals(ucwords($sentence), _ucwords($sentence));
 }
开发者ID:yfix,项目名称:yf,代码行数:10,代码来源:class_utf8.Test.php

示例2: strtoupper

 /**
  * Makes a UTF-8 string uppercase.
  * @see http://php.net/strtoupper
  *
  * @author  Andreas Gohr <andi@splitbrain.org>
  *
  * @param   string   mixed case string
  * @return  string
  */
 public static function strtoupper($str)
 {
     if (!isset(self::$called[__FUNCTION__])) {
         require SYSPATH . 'core/utf8/' . __FUNCTION__ . EXT;
         // Function has been called
         self::$called[__FUNCTION__] = TRUE;
     }
     return _strtoupper($str);
 }
开发者ID:momoim,项目名称:momo-api,代码行数:18,代码来源:utf8.php

示例3: strtoupper

 /**
  * Makes a UTF-8 string uppercase. This is a UTF8-aware version
  * of [strtoupper](http://php.net/strtoupper).
  *
  * @author  Andreas Gohr <andi@splitbrain.org>
  * @param   string   mixed case string
  * @return  string
  * @uses    UTF8::$server_utf8
  * @uses    Kohana::$charset
  */
 public static function strtoupper($str)
 {
     if (UTF8::$server_utf8) {
         return mb_strtoupper($str, Kohana::$charset);
     }
     if (!isset(self::$called[__FUNCTION__])) {
         require SYSPATH . 'utf8' . DIRECTORY_SEPARATOR . __FUNCTION__ . EXT;
         // Function has been called
         self::$called[__FUNCTION__] = TRUE;
     }
     return _strtoupper($str);
 }
开发者ID:gilyaev,项目名称:framework-bench,代码行数:22,代码来源:utf8.php

示例4: strtoupper

 public static function strtoupper($str)
 {
     if (UTF8::$server_utf8) {
         return mb_strtoupper($str, JsonApiApplication::$charset);
     }
     if (!isset(UTF8::$called[__FUNCTION__])) {
         require JsonApiApplication::find_file("utf8", __FUNCTION__);
         // Function has been called
         UTF8::$called[__FUNCTION__] = TRUE;
     }
     return _strtoupper($str);
 }
开发者ID:benshez,项目名称:DreamWeddingCeremonies,代码行数:12,代码来源:UTF8.php

示例5: strtoupper

 /**
  * Makes a UTF-8 string uppercase.
  * @see http://php.net/strtoupper
  *
  * @author  Andreas Gohr <andi@splitbrain.org>
  *
  * @param   string   mixed case string
  * @return  string
  */
 public static function strtoupper($str)
 {
     require_once dirname(__FILE__) . '/' . __FUNCTION__ . '.php';
     return _strtoupper($str);
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:14,代码来源:lib.utf8.php

示例6: get_request_variable

$page_title = 'Выбор информационного объекта';
include SITE_FILE_ROOT . 'template/simple_header.php';
$sort = 'name';
$sort_dir = 'asc';
$pattern = get_request_variable('pattern', '');
$letter = get_request_variable('letter', '');
$_REQUEST['callback'] = get_request_variable('callback', '');
$_REQUEST['cat_id'] = get_request_variable('cat_id', '');
$io_id = get_request_variable('io_id', '');
$save = get_request_variable('save', '');
$where = array();
if ($pattern != '') {
    $where[] = '"name" LIKE \'%' . db_class::escape_like($pattern) . '%\'';
    $letter = '';
} elseif ($letter != '') {
    $where[] = '"name" LIKE \'' . db_class::escape_like($letter) . '%\' OR  "name" LIKE \'' . db_class::escape_like(_strtoupper($letter)) . '%\' ';
}
if ($save) {
    if ($_REQUEST['io_id'] > 0 && $_REQUEST['cat_id'] > 0) {
        $io_rub = new io_rubricator();
        $io_rub->id_rubric = $_REQUEST['cat_id'];
        $io_rub->id_io_object = $io_id;
        $io_rub->Save();
    }
}
if ($_REQUEST['cat_id'] > 0) {
    $rubricator = new rubricator();
    $rubricator->id = $_REQUEST['cat_id'];
    $rubricator->Load();
    $db = db_class::get_instance();
    $query = 'SELECT id_io_object as id FROM ' . TABLE_IO_RUBRICATOR . ' WHERE id_rubric=' . $rubricator->id;
开发者ID:YuriyRusinov,项目名称:reper,代码行数:31,代码来源:select-object.php

示例7: strtoupper

 /**
  * Makes a UTF-8 string uppercase. This is a UTF8-aware version
  * of [strtoupper](http://php.net/strtoupper).
  *
  * @author  Andreas Gohr <andi@splitbrain.org>
  * @param   string  $str mixed case string
  * @return  string
  * @uses    UTF8::$server_utf8
  * @uses    Kohana::$charset
  */
 public static function strtoupper($str)
 {
     if (UTF8::$server_utf8) {
         return mb_strtoupper($str, Kohana::$charset);
     }
     if (!isset(UTF8::$called[__FUNCTION__])) {
         require Kohana::find_file('utf8', __FUNCTION__);
         // Function has been called
         UTF8::$called[__FUNCTION__] = TRUE;
     }
     return _strtoupper($str);
 }
开发者ID:Chinese1904,项目名称:openclassifieds2,代码行数:22,代码来源:UTF8.php

示例8: strtoupper

 /**
  * Makes a UTF-8 string uppercase
  *
  * This is a UTF8-aware version of [strtoupper](http://php.net/strtoupper).
  *
  * @author  Andreas Gohr <andi@splitbrain.org>
  *
  * @param   string  $str  Mixed case string
  *
  * @return  string
  *
  * @uses    UTF8::$server_utf8
  * @uses    Kohana::$charset
  * @uses    Kohana::find_file
  */
 public static function strtoupper($str)
 {
     if (self::$server_utf8) {
         return mb_strtoupper($str, Kohana::$charset);
     }
     UTF8::_load(__FUNCTION__);
     return _strtoupper($str);
 }
开发者ID:ultimateprogramer,项目名称:cms,代码行数:23,代码来源:utf8.php

示例9: strtoupper

 /**
  * Makes a UTF-8 string uppercase. This is a UTF8-aware version
  * of [strtoupper](http://php.net/strtoupper).
  *
  * @author  Andreas Gohr <andi@splitbrain.org>
  * @param   string  $str mixed case string
  * @return  string
  * @uses    UTF8::$server_utf8
  * @uses    Phalcana\Phalcana::$charset
  */
 public static function strtoupper($str)
 {
     if (UTF8::$server_utf8) {
         return mb_strtoupper($str, Phalcana::$charset);
     }
     if (!isset(UTF8::$called[__FUNCTION__])) {
         require Phalcana::$di->get('fs')->findFile('utf8', __FUNCTION__);
         // Function has been called
         UTF8::$called[__FUNCTION__] = true;
     }
     return _strtoupper($str);
 }
开发者ID:braf,项目名称:phalcana-core,代码行数:22,代码来源:UTF8.php

示例10: translate_string


//.........这里部分代码省略.........
     $input_string = trim($input_string);
     DEBUG_MODE && $this->_calls[$input_string]++;
     if ($this->USE_TRANSLATE_CACHE && empty($args)) {
         $CACHE_NAME = $lang . '#____#' . $input_string;
         if (isset($this->_LOCALE_CACHE[$CACHE_NAME])) {
             return $this->_LOCALE_CACHE[$CACHE_NAME];
         }
     }
     $is_translated = false;
     $_source = $input_string;
     $output_string = $input_string;
     // Try to find prefix (starts with '::')
     $_prefix = '';
     $_prefix_length = 0;
     if ($input_string[0] == ':' && $input_string[1] == ':') {
         $_prefix = substr($input_string, 0, strpos($input_string, '::', 2) + 2);
         $_prefix_length = strlen($_prefix);
         $input_string = substr($input_string, $_prefix_length);
     }
     if ($this->TRANSLATE_ENABLED) {
         // Prepare for case ignore
         if ($this->VARS_IGNORE_CASE) {
             $first_input_string = $input_string;
             $input_string = strtolower($input_string);
             if ($this->REPLACE_UNDERSCORE) {
                 $input_string = str_replace('&nbsp;', ' ', $input_string);
                 $input_string = str_replace(' ', '_', $input_string);
             }
         }
         // Try to find prefix (starts with '::') again
         if (!strlen($_prefix) && isset($this->TR_VARS[$lang]['::' . $_GET['object'] . '::' . $input_string])) {
             $_prefix = '::' . $_GET['object'] . '::';
         }
         // First try to translate var with prefix
         if (strlen($_prefix) && isset($this->TR_VARS[$lang][$_prefix . $input_string])) {
             $output_string = $this->TR_VARS[$lang][$_prefix . $input_string];
             $is_translated = true;
             // Then common var
         } elseif (isset($this->TR_VARS[$lang][$input_string])) {
             $output_string = $this->TR_VARS[$lang][$input_string];
             $is_translated = true;
             // Then try _un_html_entities
         } elseif (($var_un_html = $this->_un_html_entities($input_string)) && isset($this->TR_VARS[$lang][$var_un_html])) {
             $output_string = $this->TR_VARS[$lang][$var_un_html];
             $is_translated = true;
             // Last - is untranslated
         } else {
             $output_string = $input_string;
             if (DEBUG_MODE) {
                 if (!isset($this->_NOT_TRANSLATED)) {
                     $this->_NOT_TRANSLATED = [];
                 }
                 if (!isset($this->_NOT_TRANSLATED[$lang])) {
                     $this->_NOT_TRANSLATED[$lang] = [];
                 }
                 if (!isset($this->_NOT_TRANSLATED[$lang][$input_string])) {
                     $this->_NOT_TRANSLATED[$lang][$input_string] = 0;
                 }
                 $this->_NOT_TRANSLATED[$lang][$input_string]++;
                 // Check if such variable exists
                 if ($this->AUTO_FIND_VARS && !isset($this->TR_ALL_VARS[$input_string])) {
                     $this->insert_var($input_string);
                 }
             }
         }
     }
     if ($this->REPLACE_UNDERSCORE && !$is_translated) {
         $output_string = str_replace('_', ' ', $_source);
         if ($_prefix_length) {
             $output_string = substr($output_string, $_prefix_length);
         }
     }
     if (!empty($args) && is_array($args)) {
         $output_string = $this->_process_sub_patterns($output_string, $args);
         $output_string = strtr($output_string, $args);
     }
     if ($this->TRACK_FIRST_LETTER_CASE && $is_translated) {
         $input = $this->VARS_IGNORE_CASE ? $first_input_string : $input_string;
         $first_s = substr($input, 0, 1);
         $first_t = _substr($output_string, 0, 1);
         $first_s_lower = strtolower($first_s) == $first_s;
         $first_t_lower = _strtolower($first_t) == $first_t;
         if (!$first_s_lower && $first_t_lower) {
             $output_string = _strtoupper($first_t) . _substr($output_string, 1);
         }
     }
     if (DEBUG_MODE) {
         if ($this->WRAP_VARS_FOR_INLINE_EDIT && false === strpos($output_string, 'class=localetr')) {
             $r = [' ' => '%20', '=' => '&equals;', '<' => '&lt;', '>' => '&gt;'];
             $svar = _prepare_html(str_replace(array_keys($r), array_values($r), $_source));
             $output_string = '<span class=localetr svar=' . $svar . '>' . $output_string . '</span>';
         }
         debug('i18n[]', ['name_orig' => $_source, 'name' => $input_string, 'out' => $output_string, 'lang' => $lang, 'args' => $args ?: '', 'translated' => (int) $is_translated, 'time' => round(microtime(true) - $_start_time, 5), 'trace' => main()->trace_string()]);
     }
     // Put to cache
     if ($this->USE_TRANSLATE_CACHE && empty($args)) {
         $this->_LOCALE_CACHE[$CACHE_NAME] = $output_string;
     }
     return $output_string;
 }
开发者ID:yfix,项目名称:yf,代码行数:101,代码来源:yf_i18n.class.php


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