how I explode in PHP uppercase words? Like:
$text = "HELLO world FROM BRAZIL";
$up = explode(' ',$text);
($up[0] = HELLO, $up[1] = world, $up[2] = FROM BRAZIL)
Thanks
Don't use explode()
, try preg_split()
:
$up = preg_split('/\s([^A-Z]+)/', $text, -1, PREG_SPLIT_DELIM_CAPTURE);