If I had:
$string = \"PascalCase\";
I need
\"pascal_case\"
Does PHP offer a function for this purpose?>
This is one of shorter ways:
function camel_to_snake($input) { return strtolower(ltrim(preg_replace('/([A-Z])/', '_\\1', $input), '_')); }