-1

Possible Duplicate:
Split word by capital letter

how i can transform one string in one array with the rule for capitalize letters? Ex:

$string = "TimBurton";

$array[0] = "Tim";

$array[1] = "Burton";

Community
  • 1
  • 1

1 Answers1

4
$array = preg_split('/(?=[A-Z])/', $string);

See it here in action: http://codepad.viper-7.com/0E2DqO

Joseph Silber
  • 214,931
  • 59
  • 362
  • 292