PHP 8.5.0 Alpha 1 available for testing

Voting

: min(zero, one)?
(Example: nine)

The Note You're Voting On

svetoslavm at gmail dot com
16 years ago
For some reason this worked for me.

Mac OS 10.5.1
PHP 5.2.6

<?php
/**
* ucfirst UTF-8 aware function
*
* @param string $string
* @return string
* @see http://ca.php.net/ucfirst
*/
function my_ucfirst($string, $e ='utf-8') {
if (
function_exists('mb_strtoupper') && function_exists('mb_substr') && !empty($string)) {
$string = mb_strtolower($string, $e);
$upper = mb_strtoupper($string, $e);
preg_match('#(.)#us', $upper, $matches);
$string = $matches[1] . mb_substr($string, 1, mb_strlen($string, $e), $e);
} else {
$string = ucfirst($string);
}
return
$string;
}
?>

Svetoslav Marinov
http://slavi.biz

<< Back to user notes page

To Top