Skip to content

Instantly share code, notes, and snippets.

@lfbittencourt
Last active November 27, 2016 21:04
Show Gist options
  • Save lfbittencourt/881f55c2d95810568ed7 to your computer and use it in GitHub Desktop.
Save lfbittencourt/881f55c2d95810568ed7 to your computer and use it in GitHub Desktop.
mb_ucfirst
<?php
function mb_ucfirst($value)
{
return mb_strtoupper(mb_substr($value, 0, 1)) . mb_substr($value, 1);
}
@kenan-recebli
Copy link

maybe strtolower?

function mb_lcfirst($value)
{
return mb_strtolower(mb_substr($value, 0, 1)) . mb_substr($value, 1);
}

strtoupper for for the mb_ucfirst:

function mb_ucfirst($value)
{
return mb_strtoupper(mb_substr($value, 0, 1)) . mb_substr($value, 1);
}

@lfbittencourt
Copy link
Author

@Tecvid Haven't seen your comment before! You're right. I fixed function's name :-) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment