Hello!
I’m new to Kirby since 2 months, but already love it! I came from modx and webflow, and beginner in php.
My question: why the php ucfirst() and the kirby Str::ucfirst() give not the same result?
<?= ucfirst('youHOU') ?> // YouHOU
it’s what I want and I think the normal result. But the Kirby method give
That’s because Str::ucfirst() lowercases all but the first letter. also, it applies the utf8 safe versions mb_strtoupper($string ?? '', 'UTF-8'); and its lowercase equivalent the to uppercase/lowser those string parts.
OK so Str::ucfirst() is not only a UTF-8 safe version of ucfirst() as explain in Kirby doc, it has other goal.
I can’t use Str::ucfirst() for a text field where I want a sentence case and let other letters as it was entry.