Welcome Guest, Not a member yet? Register   Sign In
uncamelize - Inflector Helper Extension
#1

[eluser]darkhouse[/eluser]
I needed to take some camelized strings and convert them back to regular strings, so I made this little function to extend the inflector helper. I know it's not much, but I searched the forums for it and couldn't find anything, so here it is if anyone needs it.

Code:
if(!function_exists('uncamelize')){
    function uncamelize($str, $delimiter=' '){
        $str = strtolower(preg_replace('/([A-Z])/', $delimiter.'$1', $str));
        return $str;
    }
}




Theme © iAndrew 2016 - Forum software by © MyBB