PHP 8.5.0 Beta 1 available for testing

Voting

: one minus zero?
(Example: nine)

The Note You're Voting On

mhuggins57 at yahoo dot com
20 years ago
There's a ucfirst "function" to make the first character uppercase, but there's no "lcfirst" function to make the first character lowercase. Here's my own code to accomplish this.

<?
function lcfirst($str) {
return strtolower(substr($str, 0, 1)) . substr($str, 1);
}
?>

I found this particularly useful for generating XML nodes with the Reflection class.

<< Back to user notes page

To Top