public function camelize($string, $spacify = true, $lazy = false)
{
if ($spacify) {
$repl = "str_replace('_',' ',strtoupper('\\1'))";
} else {
$repl = "strtoupper('\\2')";
}
$ret = preg_replace("`(?<=[a-z0-9])(_([a-z0-9]))`e", $repl, $string);
if ($lazy) {
return lcfirst($ret);
} else {
return ucfirst($ret);
}
}