CKTIS / PHP
lcfirst()
Pasa el primer byte a minúscula si es una mayúscula ASCII y conserva el resto.
Versión: PHP 8.4; repository runtime, production runtime not attested
Sintaxis
lcfirst(string $string): stringPasa el primer byte a minúscula si es una mayúscula ASCII y conserva el resto. Desde PHP 8.2 no depende de la configuración regional. Un signo o letra multibyte inicial deja intactas las letras posteriores.
Firma
lcfirst(string $string): string
Salida del ejemplo
["xMLTag","-Name","École",""]
Ejemplos
<?php
echo json_encode([lcfirst("XMLTag"),lcfirst("-Name"),lcfirst("\u{00C9}cole"),lcfirst("")],JSON_UNESCAPED_UNICODE);
Resultado
["xMLTag","-Name","École",""]