User Tools

Site Tools


uphp:functions:ucfirst

ucfirst

WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0

Convert a string to lowercase except for the first character

Description

string ucfirst ( string $input )

Parameter

$input: A string

Return Values

Lowercase string with the first character capitalized (if that character is alphabetic)

Example

<?
  $str="Mary Had A Little Lamb and She LOVED It So";
  $str=ucfirst($str);
  print($str); // Prints "Mary had a little lamb and she loved it so"
?>

Note

This uPHP function is not exactly like the mainline PHP function ucfirst, which does not automatically convert the balance of the string beyond the first character to lowercase.

See Also

charat() - Return the ASCII code for a character in a string at an index

strlen() - Return the length of a string

strpos() - Return the position of the first occurrence of a needle in a haystack

strrpos() - Return the position of the last occurrence of a needle in a haystack

strtolower() - Return the lowercase version of a string

strtoupper() - Return the UPPERCASE version of a string

substr() - Return part of a string

uphp/functions/ucfirst.txt · Last modified: 2021/09/13 05:57 (external edit)