Initial Kohana install
[speedfreak] / Server / system / core / utf8 / ucfirst.php
1 <?php defined('SYSPATH') OR die('No direct access allowed.');
2 /**
3  * utf8::ucfirst
4  *
5  * @package    Core
6  * @author     Kohana Team
7  * @copyright  (c) 2007 Kohana Team
8  * @copyright  (c) 2005 Harry Fuecks
9  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
10  */
11 function _ucfirst($str)
12 {
13         if (utf8::is_ascii($str))
14                 return ucfirst($str);
15
16         preg_match('/^(.?)(.*)$/us', $str, $matches);
17         return utf8::strtoupper($matches[1]).$matches[2];
18 }