Should I be using mb_convert_case
with MB_CASE_TITLE
or ucwords
? Or something else? What will the differences be?
It depends.
mb_convert_case()
is multibyte safe. ucwords()
is not.
mb_convert_case()
requires an extension that is not always available. ucwords()
is always available.
So if your application will only ever use single-byte encodings then ucwords()
gives you better portability.
But if your application might need to process multi-byte encodings then ucwords()
will fail you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With