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


PHP _ucfirst函数代码示例

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


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

示例1: go

 /**
  * Create Alphabet search criteria.Make alphabet html and query limit for selected chars
  * 
  * @example list($body, $like) = $this->make_alphabet('./?object='.__CLASS__.'&action=show', $_GET['id'], 'id');
  * 
  * @param $url	: default URL for all link
  * @param $chars : current selected first and second chars for limit
  * @param $get_var_name : variable name for $_GET requert. Default: 'id'
  * @param $q_var : name variable for query
  * 
  * @return array($html, $like) : $html - variable contain html text for show in browser,
  *								$like - variable contain where clause fo mysql query
  * @return array($html, $char1, $char2): $html - variable contain html text for show in browser,
  *										$char1 - first char
  *										$char2 - second char
  * @public
  */
 function go($url, &$chars, $get_var_name = 'id', $q_var = 'id')
 {
     $nUrl = $url . '&' . $get_var_name . '=';
     $chars = strtolower(substr($chars . '11', 0, 2));
     $sel_style = ' style="background-color:#ccc;"';
     $html = '<a href="' . $nUrl . '1"' . ($chars[0] == '1' ? $sel_style : '') . '> # </a>&nbsp;';
     for ($i = 'a'; $i <= 'z'; $i = chr(ord($i) + 1)) {
         $html .= '<a href="' . $nUrl . $i . '"' . ($chars[0] == $i ? $sel_style : '') . '> ' . _ucfirst($i) . ' </a>&nbsp;';
     }
     $html .= '<br /><span class="small_alphabet">';
     $html .= '<a href="' . $nUrl . $chars[0] . '1"' . ($chars[1] == '1' ? $sel_style : '') . '>' . ($chars[0] == '1' ? '#' : $chars[0]) . '#</a> ';
     for ($i = 'a'; $i <= 'z'; $i = chr(ord($i) + 1)) {
         $html .= '<a href="' . $nUrl . $chars[0] . $i . '"' . ($i == $chars[1] ? $sel_style : '') . '>' . ($chars[0] == '1' ? '#' : $chars[0]) . $i . '</a> ';
     }
     $html .= '</span>';
     if ($chars[0] == '1' && $chars[1] == '1') {
         $like = '';
     } elseif ($chars[0] != '1' && $chars[1] == '1') {
         $like = " AND " . $q_var . " LIKE '" . $chars[0] . "%' ";
     } elseif ($chars[0] == '1' && $chars[1] != '1') {
         $like = " AND " . $q_var . " REGEXP '^[a-zA-Z0-9\\_\\-\\s]{1}" . $chars[1] . ".*' ";
     } else {
         $like = " AND " . $q_var . " LIKE '" . $chars[0] . $chars[1] . "%' ";
     }
     return [$html, $like];
 }
开发者ID:yfix,项目名称:yf,代码行数:43,代码来源:yf_make_alphabet.class.php

示例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));
 }
开发者ID:yfix,项目名称:yf,代码行数:10,代码来源:class_utf8.Test.php

示例3: ucfirst

 /**
  * Makes a UTF-8 string's first character uppercase. This is a UTF8-aware
  * version of [ucfirst](http://php.net/ucfirst).
  *
  *     $str = UTF8::ucfirst($str);
  *
  * @author  Harry Fuecks <hfuecks@gmail.com>
  * @param   string   mixed case string
  * @return  string
  */
 public static function ucfirst($str)
 {
     if (!isset(self::$called[__FUNCTION__])) {
         require SYSPATH . 'utf8' . DIRECTORY_SEPARATOR . __FUNCTION__ . EXT;
         // Function has been called
         self::$called[__FUNCTION__] = TRUE;
     }
     return _ucfirst($str);
 }
开发者ID:gilyaev,项目名称:framework-bench,代码行数:19,代码来源:utf8.php

示例4: ucfirst

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

示例5: ucfirst

 /**
  * Makes a UTF-8 string's first character uppercase.
  * @see http://php.net/ucfirst
  *
  * @author  Harry Fuecks <hfuecks@gmail.com>
  *
  * @param   string   mixed case string
  * @return  string
  */
 public static function ucfirst($str)
 {
     require_once dirname(__FILE__) . '/' . __FUNCTION__ . '.php';
     return _ucfirst($str);
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:14,代码来源:lib.utf8.php

示例6: addslashes

<?php

$data = $this->DB->query("SELECT `krs_jedyni_akcjonariusze`.nazwa, `krs_jedyni_akcjonariusze`.imiona, `krs_osoby`.`id`, `krs_osoby`.`data_urodzenia`, `krs_osoby`.`privacy_level` \n\t\tFROM `krs_jedyni_akcjonariusze` \n\t\tLEFT JOIN `krs_osoby` \n\t\tON `krs_jedyni_akcjonariusze`.`osoba_id` = `krs_osoby`.`id` \n\t\tWHERE `krs_jedyni_akcjonariusze`.`pozycja_id` = '" . addslashes($id) . "' AND `krs_jedyni_akcjonariusze`.`deleted`='0'\n\t\tORDER BY `krs_jedyni_akcjonariusze`.`ord` ASC LIMIT 100");
$output = array();
foreach ($data as $d) {
    $output[] = array('nazwa' => _ucfirst($d['krs_jedyni_akcjonariusze']['nazwa'] . ' ' . $d['krs_jedyni_akcjonariusze']['imiona']), 'data_urodzenia' => $d['krs_osoby']['data_urodzenia'], 'privacy_level' => $d['krs_osoby']['privacy_level'], 'osoba_id' => @$d['krs_osoby']['id']);
}
return $output;
开发者ID:slachiewicz,项目名称:_mojePanstwo-API-Server,代码行数:8,代码来源:jedynyAkcjonariusz.php

示例7: ucfirst

 /**
  * Makes a UTF-8 string's first character uppercase. This is a UTF8-aware
  * version of [ucfirst](http://php.net/ucfirst).
  *
  *     $str = UTF8::ucfirst($str);
  *
  * @author  Harry Fuecks <hfuecks@gmail.com>
  * @param   string  $str mixed case string
  * @return  string
  */
 public static function ucfirst($str)
 {
     if (!isset(UTF8::$called[__FUNCTION__])) {
         require Kohana::find_file('utf8', __FUNCTION__);
         // Function has been called
         UTF8::$called[__FUNCTION__] = TRUE;
     }
     return _ucfirst($str);
 }
开发者ID:Chinese1904,项目名称:openclassifieds2,代码行数:19,代码来源:UTF8.php

示例8: show_site_title

 /**
  * Show site title
  */
 function show_site_title()
 {
     if (defined('SITE_ADVERT_NAME')) {
         $title = SITE_ADVERT_NAME;
     }
     if (conf('SITE_ADVERT_NAME')) {
         $title = conf('SITE_ADVERT_NAME');
     }
     if (defined('SITE_TITLE')) {
         $title = SITE_TITLE;
     }
     if (!empty($this->META_TITLE)) {
         $title = $this->META_TITLE;
     }
     // For compatibility with old versions
     $website_name = conf('website_name');
     if (strlen($website_name)) {
         $title = $website_name;
     }
     // Add pages names to the title
     if ($this->ADD_TITLE_PAGES) {
         if (strlen($_GET['object']) && $_GET['object'] != 'static_pages') {
             $title .= ' :: ' . _ucfirst(t($_GET['object']));
             $title = _ucfirst(t($_GET['object'])) . ' : ' . $title;
         }
     }
     // Override by hook method
     // TODO: maybe need to check permissions at first
     $obj = module_safe($_GET['object']);
     if (is_object($obj)) {
         $hook_names = ['_hook_title', '_site_title'];
         foreach ($hook_names as $method_name) {
             if (method_exists($obj, $method_name)) {
                 $title = $obj->{$method_name}($title);
                 break;
             }
         }
     }
     // Force by global var
     $conf_title = conf('site_title');
     if ($conf_title) {
         $title = $conf_title;
     }
     $title = preg_replace('~\\s+~ims', ' ', $title);
     return _prepare_html($title);
 }
开发者ID:yfix,项目名称:yf,代码行数:49,代码来源:yf_graphics.class.php

示例9: settings_theme


//.........这里部分代码省略.........
<input type="text" name="remote_mysql" size="20" value="' . aPOSTval('remote_mysql', @$globals['remote_mysql']) . '" />
</td>
</tr>';
    }
    if (!defined('SOFTRESELLER')) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['soft_email'] . '</span><br />
<span class="sai_exp2">' . $l['soft_email_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="soft_email" size="30" value="' . aPOSTval('soft_email', $globals['soft_email']) . '" />
</td>
</tr>';
    }
    echo '<tr>
<td>
<span class="sai_head">' . $l['from_email'] . '</span><br />
<span class="sai_exp2">' . $l['from_email_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="from_email" size="30" value="' . aPOSTval('from_email', $globals['from_email']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['choose_lang'] . '</span><br />
<span class="sai_exp2">' . $l['choose_lang_exp'] . '</span>
</td>
<td valign="top">
<select name="language">';
    foreach ($langs as $k => $v) {
        echo '<option value="' . $v . '" ' . (empty($_POST['language']) && $globals['language'] == $v ? 'selected="selected"' : (@trim($_POST['language']) == $v ? 'selected="selected"' : '')) . '>' . _ucfirst($v) . '</option>';
    }
    echo '</select>
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['choose_protocol'] . '</span><br />
<span class="sai_exp2">' . $l['choose_protocol_exp'] . '</span>
</td>
<td>
<select name="default_protocol">';
    foreach ($protocols as $pk => $pv) {
        echo '<option value="' . $pk . '" ' . ($globals['default_protocol'] == $pk ? 'selected="selected"' : '') . '>' . $pv . '</option>';
    }
    echo '</select>
</td>
</tr>';
    if (!defined('SOFTRESELLER')) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['choose_theme'] . '</span><br />
<span class="sai_exp2">' . $l['choose_theme_exp'] . '</span>
</td>
<td valign="top">
<select name="theme_folder">';
        foreach ($skins as $k => $v) {
            echo '<option value="' . $v . '" ' . (empty($_POST['theme_folder']) && $globals['theme_folder'] == $v ? 'selected="selected"' : (trim($_POST['theme_folder']) == $v ? 'selected="selected"' : '')) . '>' . _ucfirst($v) . '</option>';
        }
        echo '</select>
</td>
</tr>
开发者ID:Hezkibel,项目名称:soft,代码行数:67,代码来源:settings_theme.php

示例10: addslashes

<?php

$data = $this->DB->query("SELECT `krs_nadzorcy`.nazwa, `krs_nadzorcy`.imiona, `krs_osoby`.`id`, `krs_osoby`.`data_urodzenia`, `krs_osoby`.`privacy_level` \n\t\tFROM `krs_nadzorcy` \n\t\tLEFT JOIN `krs_osoby` \n\t\tON `krs_nadzorcy`.`osoba_id` = `krs_osoby`.`id` \n\t\tWHERE `krs_nadzorcy`.`pozycja_id` = '" . addslashes($id) . "' AND `krs_nadzorcy`.`deleted`='0' AND `krs_nadzorcy`.`removed`='0' \n\t\tORDER BY `krs_nadzorcy`.`ord` ASC LIMIT 100");
$output = array();
foreach ($data as $d) {
    $output[] = array('nazwa' => _ucfirst($d['krs_nadzorcy']['nazwa'] . ' ' . $d['krs_nadzorcy']['imiona']), 'data_urodzenia' => $d['krs_osoby']['data_urodzenia'], 'privacy_level' => $d['krs_osoby']['privacy_level'], 'osoba_id' => @$d['krs_osoby']['id']);
}
return $output;
开发者ID:slachiewicz,项目名称:_mojePanstwo-API-Server,代码行数:8,代码来源:nadzor.php

示例11: _set_global_info

 /**
  * Set page infor for global use
  */
 function _set_global_info($a = [])
 {
     $this->PAGE_NAME = _prepare_html($a['name']);
     $this->PAGE_HEADING = _prepare_html(_ucfirst($a['page_heading']));
     $this->PAGE_TITLE = _prepare_html(_ucfirst($a['title'] ? $a['title'] : $a['page_title']));
     conf('meta_keywords', _prepare_html($a['meta_keywords']));
     conf('meta_description', _prepare_html($a['meta_desc']));
 }
开发者ID:yfix,项目名称:yf,代码行数:11,代码来源:yf_static_pages.class.php

示例12: ucfirst

 /**
  * Makes a UTF-8 string's first character uppercase. This is a UTF8-aware
  * version of [ucfirst](http://php.net/ucfirst).
  *
  *     $str = UTF8::ucfirst($str);
  *
  * @author  Harry Fuecks <hfuecks@gmail.com>
  * @param   string  $str mixed case string
  * @return  string
  */
 public static function ucfirst($str)
 {
     if (!isset(UTF8::$called[__FUNCTION__])) {
         require Phalcana::$di->get('fs')->findFile('utf8', __FUNCTION__);
         // Function has been called
         UTF8::$called[__FUNCTION__] = true;
     }
     return _ucfirst($str);
 }
开发者ID:braf,项目名称:phalcana-core,代码行数:19,代码来源:UTF8.php

示例13: _show_execution_time

 /**
  * Show execution time info
  */
 function _show_execution_time()
 {
     main()->_time_end = $this->_format_time_value(microtime(true) - main()->_time_start);
     return '<div align="center" id="debug_exec_time">' . _ucfirst(t('page_generated_in')) . ' ' . main()->_time_end . ' ' . t('seconds') . ', &nbsp;&nbsp;' . t('number_of_queries') . ' = ' . intval(db()->NUM_QUERIES) . '</div>' . PHP_EOL;
 }
开发者ID:yfix,项目名称:yf,代码行数:8,代码来源:yf_common.class.php

示例14: addslashes

<?php

$data = $this->DB->selectAssocs("SELECT `krs_wspolnicy`.`id`, `krs_wspolnicy`.nazwa, `krs_wspolnicy`.imiona, `krs_wspolnicy`.udzialy_str, `krs_osoby`.`id` as 'osoba_id', `krs_pozycje`.`id` as 'krs_id', `krs_osoby`.`data_urodzenia`, `krs_osoby`.`privacy_level`, `krs_wspolnicy`.`udzialy_status`, `krs_wspolnicy`.`udzialy_liczba`, `krs_wspolnicy`.`udzialy_wartosc_jedn`, `krs_wspolnicy`.`udzialy_wartosc` \n\t\tFROM `krs_wspolnicy` \n\t\tLEFT JOIN `krs_osoby` ON `krs_wspolnicy`.`osoba_id` = `krs_osoby`.`id` \n\t\tLEFT JOIN `krs_pozycje` ON `krs_wspolnicy`.`krs_id` = `krs_pozycje`.`id` \n\t\tWHERE `krs_wspolnicy`.`pozycja_id` = '" . addslashes($id) . "' AND `krs_wspolnicy`.`deleted`='0'\n\t\tORDER BY `krs_wspolnicy`.`ord` ASC LIMIT 100");
$output = array();
foreach ($data as $d) {
    $nazwa = $d['nazwa'];
    $imiona = $d['imiona'];
    if (!trim(str_replace('*', '', $nazwa))) {
        $nazwa = '';
    }
    if (!trim(str_replace('*', '', $imiona))) {
        $imiona = '';
    }
    $o = array('nazwa' => _ucfirst(trim($nazwa . ' ' . $imiona)), 'data_urodzenia' => $d['data_urodzenia'], 'privacy_level' => $d['privacy_level'], 'osoba_id' => @$d['osoba_id'], 'krs_id' => @$d['krs_id'], 'id' => @$d['id'], 'funkcja' => @$d['udzialy_str']);
    if ($d['udzialy_status'] == '2') {
        $o = array_merge($o, array('udzialy_liczba' => @$d['udzialy_liczba'], 'udzialy_wartosc_jedn' => @$d['udzialy_wartosc_jedn'], 'udzialy_wartosc' => @$d['udzialy_wartosc']));
    }
    $output[] = $o;
}
return $output;
开发者ID:slachiewicz,项目名称:_mojePanstwo-API-Server,代码行数:20,代码来源:wspolnicy.php

示例15: addslashes

<?php

$data = $this->DB->query("SELECT `krs_reprezentanci`.nazwa, `krs_reprezentanci`.imiona, `krs_reprezentanci`.funkcja, `krs_osoby`.`id`, `krs_osoby`.`data_urodzenia`, `krs_osoby`.`privacy_level`  \n\t\tFROM `krs_reprezentanci` \n\t\tLEFT JOIN `krs_osoby` \n\t\tON `krs_reprezentanci`.`osoba_id` = `krs_osoby`.`id` \n\t\tWHERE `krs_reprezentanci`.`pozycja_id` = '" . addslashes($id) . "' AND `krs_reprezentanci`.`deleted`='0'\n\t\tORDER BY `krs_reprezentanci`.`ord` ASC LIMIT 100");
$output = array();
foreach ($data as $d) {
    $output[] = array('nazwa' => _ucfirst($d['krs_reprezentanci']['nazwa'] . ' ' . $d['krs_reprezentanci']['imiona']), 'funkcja' => _ucfirst($d['krs_reprezentanci']['funkcja']), 'data_urodzenia' => $d['krs_osoby']['data_urodzenia'], 'privacy_level' => $d['krs_osoby']['privacy_level'], 'osoba_id' => @$d['krs_osoby']['id']);
}
return $output;
开发者ID:slachiewicz,项目名称:_mojePanstwo-API-Server,代码行数:8,代码来源:reprezentacja.php


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