Hướng dẫn first letter lowercase php

[PHP 5 >= 5.3.0, PHP 7, PHP 8]

lcfirstMake a string's first character lowercase

Description

lcfirst[string $string]: string

Note that 'alphabetic' is determined by the current locale. For instance, in the default "C" locale characters such as umlaut-a [ä] will not be converted.

Parameters

string

The input string.

Return Values

Returns the resulting string.

Examples

Example #1 lcfirst[] example

See Also

  • ucfirst[] - Make a string's first character uppercase
  • strtolower[] - Make a string lowercase
  • strtoupper[] - Make a string uppercase
  • ucwords[] - Uppercase the first character of each word in a string

phpnet at katylavallee dot com

13 years ago

Easiest work-around I've found for

alex aulbach

13 years ago

In some cases maybe more useful?

$lower = strtolower[ substr[$upper,0,1] ] . substr[$upper,1];

harmor

14 years ago

A slight modification from Northie's post here [ //us2.php.net/manual/en/function.ucfirst.php#68443], where lcfirst may not exist in your PHP build:

Chủ Đề