Reverse for strtolower

Script turns Barak Obama presidentin Barak Obama presidentthrough strtolower().

How to get it back in Barak Obama president?

Want to invert the strtolower()effect with a changing core script.

+3
source share
5 answers

You cannot do this unless you teach PHP to speak English. ucwords will use every word, but he cannot know which words should be capitalized if the information from the original line was lost.

+7
source

You can not. This is not reversible. How does a function know that the first two words should be capitalized, but not the third?

(, , , . , " " - .)

+4

, .

+3

ucfirst ($ )

0

, .

ToLower , ToUpper . , . .

, " ", " ".

Thus, doing everything in lower case, the inverse should make it upper case. Returning to the original string is not the reverse of the method. Therefore, I would recommend that you either just keep the original string, or develop what suits you. ucfirst ($ string) vs lcfirst ($ string).

0
source

Source: https://habr.com/ru/post/1762916/


All Articles