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


PHP ucWords函数代码示例

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


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

示例1: init

 /**
  * Standard init function to instantiate language object
  * and create title, etc
  */
 public function init()
 {
     try {
         $this->objLanguage = $this->getObject('language', 'language');
         $this->title = ucWords($this->objLanguage->code2Txt('mod_context_learneroutcomes', 'context'));
     } catch (customException $e) {
         customException::cleanUp();
     }
 }
开发者ID:ookwudili,项目名称:chisimba,代码行数:13,代码来源:block_contextoutcomes_class_inc.php

示例2: stringToName

 /**
  * Converts given string into CamelCased class name
  *
  * @return string
  * @param string $string
  */
 public static function stringToName($string)
 {
     $result = strToLower($string);
     $result = str_replace('-', ' ', $result);
     $result = ucWords($result);
     $result = str_replace(' ', '', $result);
     $result = trim($result);
     return $result;
 }
开发者ID:visor,项目名称:nano,代码行数:15,代码来源:Nano.php

示例3: getBlankXml

function getBlankXml($type)
{
    $function = 'Pulsestorm\\Magento2\\Cli\\Xml_Template';
    $function .= '\\getBlankXml' . ucWords(strToLower($type));
    if (function_exists($function)) {
        return call_user_func($function);
    }
    throw new Exception("No such type, {$type}");
}
开发者ID:benmarks,项目名称:pestle,代码行数:9,代码来源:module.php

示例4: common

 /**
  * Выполняет общее преобразование короткого имени в имя класса:
  *  - Приводит переданное значение к CamelCase
  *  - Удаляет знак "минус"
  *  - Заменяет знак "слеш" на разделитель пространства имён
  *
  * @return string
  * @param string $value
  */
 public static function common($value)
 {
     $result = preg_replace('/\\s+/', '', trim($value));
     $result = strToLower($result);
     $result = str_replace(array('-', '/'), array(' ', '. '), $result);
     $result = ucWords($result);
     $result = str_replace(array(' ', '.'), array('', NS), $result);
     return trim($result);
 }
开发者ID:visor,项目名称:nano,代码行数:18,代码来源:Names.php

示例5: init

 /**
  * Standard init function to instantiate language object
  * and create title, etc
  */
 public function init()
 {
     try {
         $this->loadClass('link', 'htmlelements');
         $this->objLanguage = $this->getObject('language', 'language');
         $this->title = ucWords($this->objLanguage->code2Txt('mod_context_aboutcontext', 'context'));
     } catch (customException $e) {
         customException::cleanUp();
     }
 }
开发者ID:ookwudili,项目名称:chisimba,代码行数:14,代码来源:block_aboutcontext_class_inc.php

示例6: mb_convert_case

 function mb_convert_case($str, $mode, $enc = '')
 {
     switch ($mode) {
         case MB_CASE_LOWER:
             return strToLower($str);
         case MB_CASE_UPPER:
             return strToUpper($str);
         case MB_CASE_TITLE:
             return ucWords(strToLower($str));
         default:
             return $str;
     }
 }
开发者ID:rkania,项目名称:GS3,代码行数:13,代码来源:mb_str_pad.php

示例7: init

 /**
  * Standard init function to instantiate language object
  * and create title, etc
  */
 public function init()
 {
     try {
         $this->objLanguage = $this->getObject('language', 'language');
         $this->title = ucWords($this->objLanguage->code2Txt('mod_context_allcontexts', 'context', NULL, 'All [-contexts-]'));
         // HTML Elements
         $this->loadClass('form', 'htmlelements');
         $this->loadClass('dropdown', 'htmlelements');
         $this->loadClass('button', 'htmlelements');
     } catch (customException $e) {
         customException::cleanUp();
     }
 }
开发者ID:ookwudili,项目名称:chisimba,代码行数:17,代码来源:block_context_class_inc.php

示例8: Radio

 function Radio($name, $value = '', $class = 'check_radio', $js_event_str = '')
 {
     $data = $this->getStatusCodes();
     $str = '';
     foreach ($data as $k => $v) {
         $slcted = '';
         if ($v == $value) {
             $slcted .= " checked='checked'";
         }
         $str .= "<input type='radio' name='" . $name . "' value='" . $v . "'" . $slcted . " class='" . $class . "'" . $js_event_str . "> " . ucWords($v) . " ";
     }
     return $str;
 }
开发者ID:samplugins,项目名称:donation-system,代码行数:13,代码来源:clsAbstractStatusCodes.php

示例9: formatName

 public static function formatName($name, $controller = true)
 {
     $result = strToLower($name);
     $result = str_replace('-', ' ', $result);
     $result = ucWords($result);
     $result = str_replace(' ', '', $result);
     $result = trim($result);
     if ($controller) {
         $result .= self::SUFFIX_CONTROLLER;
     } else {
         $result = strToLower($result[0]) . subStr($result, 1);
         $result .= self::SUFFIX_ACTION;
     }
     return $result;
 }
开发者ID:studio-v,项目名称:nano,代码行数:15,代码来源:Dispatcher.php

示例10: request

 public function request($url, $post = null)
 {
     $method = $this->getUse();
     if (in_array($method, $this->_methods)) {
         $method_name = '_request' . ucWords($method);
         if (!method_exists($this, $method_name)) {
             throw new Exception("Method {$method_name} does not exists.");
         }
         if ($this->debug()) {
             echo "\nTrying to get '{$url}' using " . strtoupper($method);
         }
         return call_user_func(array($this, $method_name), $url, $post);
     } else {
         throw new Exception('Method not seted.');
     }
 }
开发者ID:nataliajulieta,项目名称:old,代码行数:16,代码来源:frete.php

示例11: run

 /**
  * 呼び出し元のコントローラーから呼び出すモデルを判定しrun()を実行します。
  *
  * 実行モデル:
  *   同一Bundle内にコントローラー名のControllerを省く文字のディレクトリ内にある
  *   実行したActionをCamel式で表したファイル名
  */
 protected final function run($inputParam = array())
 {
     $backtrace = debug_backtrace();
     $controllerClass = get_class($this);
     $functionName = $backtrace[1]['function'];
     $serviceName = preg_replace('/Controller$/', '', preg_replace('/^.*\\\\/', '', $controllerClass));
     $actionName = ucWords(preg_replace('/Action$/', '', $functionName));
     $tmp = '\\Service\\' . $serviceName . '\\' . $actionName;
     $classPath = preg_replace('/\\\\Controller.*$/', $tmp, $controllerClass);
     $service = new $classPath($this->container);
     if (is_null($service)) {
         throw new \ErrorException('Service is not found.');
     }
     $result = $service->run($inputParam);
     return $result;
 }
开发者ID:iwatea,项目名称:Swim,代码行数:23,代码来源:AbstractController.php

示例12: init

 /**
  * Standard init function to instantiate language object
  * and create title, etc
  */
 public function init()
 {
     try {
         $this->objLanguage = $this->getObject('language', 'language');
         $this->objUserContext = $this->getObject('usercontext', 'context');
         $this->objUser = $this->getObject('user', 'security');
         $this->objContext = $this->getObject('dbcontext');
         $this->objGroups = $this->getObject('groupAdminModel', 'groupadmin');
         $this->title = ucWords($this->objLanguage->code2Txt('phrase_mycourses', 'system', NULL, 'My [-contexts-]'));
         // HTML Elements
         $this->loadClass('form', 'htmlelements');
         $this->loadClass('dropdown', 'htmlelements');
         $this->loadClass('button', 'htmlelements');
     } catch (customException $e) {
         customException::cleanUp();
     }
 }
开发者ID:ookwudili,项目名称:chisimba,代码行数:21,代码来源:block_mycontexts_class_inc.php

示例13: letrasIniciais

function letrasIniciais($nome, $minusculas = true)
{
    $nome = ucWords(strtolower($nome));
    #ESSA LINHA
    $nome = ereg_replace("Da|De|Di|Do|Du", "", $nome);
    # ESSA Tambem
    preg_match_all('/\\s?([A-Z])/', $nome, $matches);
    $ret = implode('', $matches[1]);
    return $minusculas ? strtoupper($ret) : $ret;
}
开发者ID:jesseoliveira,项目名称:e-sic-livre-git,代码行数:10,代码来源:funcoes.php

示例14: _get_request_headers_as_string

function _get_request_headers_as_string()
{
    global $_SERVER, $orig_url;
    $ret = '';
    $ret .= $_SERVER['REQUEST_METHOD'] . ' ' . $orig_url . ' ' . $_SERVER['SERVER_PROTOCOL'] . "\r\n";
    foreach ($_SERVER as $k => $v) {
        if (subStr($k, 0, 5) === 'HTTP_') {
            $k = str_replace(' ', '-', ucWords(str_replace('_', ' ', strToLower(subStr($k, 5)))));
            $ret .= $k . ': ' . $v . "\r\n";
        }
    }
    $ret .= "\r\n";
    return $ret;
}
开发者ID:hehol,项目名称:GemeinschaftPBX,代码行数:14,代码来源:prov-settings.php

示例15: execute

 function execute(&$data, &$parent)
 {
     if (!array_key_exists($this->data, $data)) {
         //echo "did not find " . $this->data;
         return "";
     }
     $result = $data[$this->data];
     if ($this->args) {
         //			print "[[" . $this->args . "]]";
         $modifiers = preg_split("!\\s!", $this->args);
         //print count($modifiers) . "modifiers";
         //			print_r($modifiers);
         foreach ($modifiers as $modifierString) {
             preg_match("!(\\w*)(.*)!", $modifierString, $matches);
             //print_r($matches);
             $modifier = $matches[1];
             //print "[$modifier]";
             $argumentString = $matches[2];
             $arguments = array();
             if ($argumentString) {
                 $delim = $argumentString[0];
                 $arguments = explode($delim, substr($argumentString, 1));
             }
             switch ($modifier) {
                 case 'capUpper':
                     $result = strtoupper($result);
                     break;
                 case 'capLower':
                     $result = strtolower($result);
                     break;
                 case 'capWord':
                     $result = ucWords($result);
                     break;
                 case 'capSentence':
                     $result = ucFirst($result);
                     break;
                 case 'trim':
                     $result = trim($result);
                     break;
                 case 'htmlencode':
                     $result = htmlentities($result);
                     break;
                 case 'htmldecode':
                     $result = html_entity_decode($result);
                     break;
                 case 'makesafe':
                     $result = mysql_real_escape_string($result);
                     break;
                 case 'utf8decode':
                     $result = utf8_decode($result);
                     break;
                 case 'utf8encode':
                     $result = utf8_encode($result);
                     break;
                 case 'strtotime':
                     $result = strtotime($result);
                     break;
                 case 'stripslashes':
                     $result = stripslashes($result);
                     break;
                 case 'addslashes':
                     $result = addslashes($result);
                     break;
                 case 'addone':
                     $result++;
                     break;
                 case 'number':
                     //print_r($arguments);
                     $dec = 2;
                     if (count($arguments) > 0) {
                         $dec = $arguments[0];
                     }
                     $dot = ",";
                     if (count($arguments) > 1) {
                         $dot = $arguments[1];
                     }
                     $sep = ".";
                     if (count($arguments) > 2) {
                         $sep = $arguments[2];
                     }
                     $result = number_format($result, $dec, $dot, $sep);
                     break;
                 case 'printf':
                     $format = "";
                     if (count($arguments) == 0) {
                         break;
                     }
                     $format = $arguments[0];
                     $result = sprintf($format, $result);
                     break;
                 case 'date':
                     $format = "";
                     if (count($arguments) == 0) {
                         break;
                     }
                     $format = $arguments[0];
                     $result = date($format, $result);
                     break;
                 default:
             }
//.........这里部分代码省略.........
开发者ID:pdelbar,项目名称:onethree,代码行数:101,代码来源:value_tbd.php


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