Convert camel to underscore

if you want to convert a camel format name, which is uppercase in every first letter of the concatenated words to lowercase words seperated by underscore




$class = 'ProcedureStep';

$name = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $class));