I want to separate upper or lower case characters.
In this text : "HELLO WORLD how are you"
I want to have in the first variable : "HELLO WORLD" and "how are you" in the second.
How can I do that with php ?
Thanks a lot
I want to separate upper or lower case characters.
In this text : "HELLO WORLD how are you"
I want to have in the first variable : "HELLO WORLD" and "how are you" in the second.
How can I do that with php ?
Thanks a lot
Just to use a different, non-regexp approach
$original = "HELLO WORLD how are you";
$upper = trim(implode(array_intersect(str_split($original),str_split(strtoupper($original)))));
$lower = trim(implode(array_intersect(str_split($original),str_split(strtolower($original)))));
echo $upper,'<br />';
echo $lower,'<br />';