本文整理汇总了PHP中_ucwords函数的典型用法代码示例。如果您正苦于以下问题:PHP _ucwords函数的具体用法?PHP _ucwords怎么用?PHP _ucwords使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_ucwords函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _show_header
function _show_header()
{
$pheader = t("Shop");
$subheader = _ucwords(str_replace("_", " ", $_GET["action"]));
$cases = ["show" => "Products", "add" => "Add product"];
if (isset($cases[$_GET["action"]])) {
$subheader = $cases[$_GET["action"]];
}
return ["header" => $pheader, "subheader" => $subheader ? _prepare_html($subheader) : ""];
}
示例2: 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));
}
示例3: ucwords
/**
* Makes the first character of every word in a UTF-8 string uppercase.
* @see http://php.net/ucwords
*
* @author Harry Fuecks <hfuecks@gmail.com>
*
* @param string mixed case string
* @return string
*/
public static function ucwords($str)
{
if (!isset(self::$called[__FUNCTION__])) {
require SYSPATH . 'core/utf8/' . __FUNCTION__ . EXT;
// Function has been called
self::$called[__FUNCTION__] = TRUE;
}
return _ucwords($str);
}
示例4: _show_header
/**
*/
function _show_header()
{
$pheader = t('Static pages');
$subheader = _ucwords(str_replace('_', ' ', $_GET['action']));
$cases = ['show' => '', 'edit' => ''];
if (isset($cases[$_GET['action']])) {
$subheader = $cases[$_GET['action']];
}
return ['header' => $pheader, 'subheader' => $subheader ? _prepare_html($subheader) : ''];
}
示例5: ucwords
/**
* Makes the first character of every word in a UTF-8 string uppercase.
* This is a UTF8-aware version of [ucwords](http://php.net/ucwords).
*
* $str = UTF8::ucwords($str);
*
* @author Harry Fuecks <hfuecks@gmail.com>
* @param string mixed case string
* @return string
* @uses UTF8::$server_utf8
*/
public static function ucwords($str)
{
if (!isset(self::$called[__FUNCTION__])) {
require SYSPATH . 'utf8' . DIRECTORY_SEPARATOR . __FUNCTION__ . EXT;
// Function has been called
self::$called[__FUNCTION__] = TRUE;
}
return _ucwords($str);
}
示例6: ucwords
public static function ucwords($str)
{
if (!isset(UTF8::$called[__FUNCTION__])) {
require JsonApiApplication::find_file("utf8", __FUNCTION__);
// Function has been called
UTF8::$called[__FUNCTION__] = TRUE;
}
return _ucwords($str);
}
示例7: ucwords
/**
* Makes the first character of every word in a UTF-8 string uppercase.
* @see http://php.net/ucwords
*
* @author Harry Fuecks <hfuecks@gmail.com>
*
* @param string mixed case string
* @return string
*/
public static function ucwords($str)
{
require_once dirname(__FILE__) . '/' . __FUNCTION__ . '.php';
return _ucwords($str);
}
示例8: ucwords
/**
* Makes the first character of every word in a UTF-8 string uppercase.
* This is a UTF8-aware version of [ucwords](http://php.net/ucwords).
*
* $str = UTF8::ucwords($str);
*
* @author Harry Fuecks <hfuecks@gmail.com>
* @param string $str mixed case string
* @return string
*/
public static function ucwords($str)
{
if (!isset(UTF8::$called[__FUNCTION__])) {
require Kohana::find_file('utf8', __FUNCTION__);
// Function has been called
UTF8::$called[__FUNCTION__] = TRUE;
}
return _ucwords($str);
}
示例9: ucwords
/**
* Makes the first character of every word in a UTF-8 string uppercase
*
* This is a UTF8-aware version of [ucwords](http://php.net/ucwords).
*
* Example:
* ~~~
* $str = UTF8::ucwords($str);
* ~~~
*
* @author Harry Fuecks <hfuecks@gmail.com>
*
* @param string $str Mixed case string
*
* @return string
*
* @uses UTF8::$server_utf8
* @uses Kohana::find_file
*/
public static function ucwords($str)
{
UTF8::_load(__FUNCTION__);
return _ucwords($str);
}
示例10: ucwords
/**
* Makes the first character of every word in a UTF-8 string uppercase.
*
* @see http://php.net/ucwords
* @author Harry Fuecks <hfuecks@gmail.com>
*
* @param string mixed case string
* @return string
*/
public static function ucwords($str)
{
if (UTF8::$server_utf8) {
return mb_convert_case($str, MB_CASE_TITLE, Kohana::$charset);
}
if (!isset(self::$called[__FUNCTION__])) {
require SYSPATH . 'utf8/' . __FUNCTION__ . EXT;
// Function has been called
self::$called[__FUNCTION__] = TRUE;
}
return _ucwords($str);
}
示例11: ucwords
/**
* Makes the first character of every word in a UTF-8 string uppercase.
* This is a UTF8-aware version of [ucwords](http://php.net/ucwords).
*
* $str = UTF8::ucwords($str);
*
* @author Harry Fuecks <hfuecks@gmail.com>
* @param string $str mixed case string
* @return string
*/
public static function ucwords($str)
{
if (!isset(UTF8::$called[__FUNCTION__])) {
require Phalcana::$di->get('fs')->findFile('utf8', __FUNCTION__);
// Function has been called
UTF8::$called[__FUNCTION__] = true;
}
return _ucwords($str);
}
示例12: _show_header
/**
* Display header content (hook)
*/
function _show_header()
{
if (conf('no_page_header')) {
return false;
}
$page_header = '';
$page_subheader = '';
// Display hook contents
// TODO: need to check permissions at first
# $obj = module($_GET['object']);
if (method_exists($obj, '_show_header')) {
$result = $obj->_show_header();
if (is_array($result)) {
$page_header = $result['header'];
$page_subheader = $result['subheader'];
} else {
return strval($result);
}
}
// Show default header
if (!isset($page_header)) {
$page_header = _ucwords(str_replace('_', ' ', $_GET['object']));
}
if (!isset($page_subheader)) {
if ($_GET['action'] != 'show') {
$page_subheader = _ucwords(str_replace('_', ' ', $_GET['action']));
}
}
$replace = ['header' => $page_header ? t($page_header) : '', 'subheader' => $page_subheader ? t($page_subheader) : ''];
return tpl()->parse('system/page_header', $replace);
}