Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Decapitalizes the first letter of the string PHP method

title tags
decapitalize
string,beginner

Decapitalizes the first Letter of a string.

  • Decapitalizes the first letter of the string and then adds it with rest of the string.
  • Omit the $upperRest parameter to keep the rest of the string intact, or set it to true to convert to uppercase.
function decapitalize($string, $upperRest = false)
{
  return lcfirst($upperRest ? strtoupper($string) : $string);
}
decapitalize('FooBar'); // 'fooBar'

CC0-1.0 license

The post Decapitalizes the first letter of the string PHP method first appeared on CodeSnippetsandTutorials™ - Code Tutorials, Graphic Design and More.



This post first appeared on Code Snippets And Tutorials, please read the originial post: here

Share the post

Decapitalizes the first letter of the string PHP method

×

Subscribe to Code Snippets And Tutorials

Get updates delivered right to your inbox!

Thank you for your subscription

×