For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > November 2004 > PhP string manipulation: ucfirst() but no "lcfirst()"









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PhP string manipulation: ucfirst() but no "lcfirst()"
Peter T

2004-11-24, 8:56 pm

Suggestion for implementation

"lcfirst()"

Given the handy ucfirst() function that turns the
first letter of a string to uppercase, it seems a pity
there's not the reverse also:
an lcfirst() turning the first letter to lowercase,
without substr(), substr_replace() etc workarounds

After all there are both strtoupper() and strtolower()
functions.

String manipulations on sentences can find uses for
both ucfirst() and lcfirst()functions, and (for
example) with Mysql systems of related larger and
smaller tables with corresponding uppercase/lowercase
first letter in mixed case names
-- and no doubt there are other possibilities of use.

[ Note:
Some may argue that the reason that there's no
lcfirst() is that sentences are usually lowercase
apart from the first letter, so that strtolower() may
be all
that's needed in such a 'reverse operation.

However: uppercase is of course found within sentences
too, eg for names (and even for nouns in some
languages),
and with modern texting/email writing/intercapping
practices that argument also applies less than before,
- and apart from uses for an lcfirst() beyond sentence
manipulation, as already mentioned. ]





________________________________________
___________________
Gesendet von Yahoo! Mail - Jetzt mit 100MB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com