I\'m using this function to convert CamelCase to dashed string:
function camel2dashed($className) { return strtolower(preg_replace(\'/([^A-Z-])([A-Z])/\'
Use a lookahead assertion:
function camel2dashed($className) { return strtolower(preg_replace('/([a-zA-Z])(?=[A-Z])/', '$1-', $className)); }
See it working online: ideone