How can I replace a set of words that look like:
SomeText
to
Some_Text
?
$result = strtolower(preg_replace('/(.)([A-Z])/', '$1_$2', $subject));
Converts:
HelloKittyOlolo Declaration CrabCoreForefer TestTest testTest
To:
hello_kitty_ololo declaration crab_core_forefer test_test test_test