function drupal_ucfirst

drupal_ucfirst($text)

Capitalizes the first letter of a UTF-8 string.

Parameters

$text: The string to convert.

Return value

The string with the first letter as uppercase.

Related topics

File

includes/unicode.inc, line 566
Provides Unicode-related conversions and operations.

Code

function drupal_ucfirst($text) {
  // Note: no mbstring equivalent!
  return drupal_strtoupper(drupal_substr($text, 0, 1)) . drupal_substr($text, 1);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!unicode.inc/function/drupal_ucfirst/7.x