public static function camelToHyphen($str, $strtolower = true) {
        if (!is_string($str))
            return '';
        $str[0] = strtolower($str[0]);
        $func = create_function('$c', 'return "-" . $c[1];');
        $str = preg_replace_callback('/([A-Z])/', $func, $str);
        return ($strtolower) ? strtolower($str) : $str;
    }
public static function camelToHyphen($str, $strtolower = true) {
        if (!is_string($str))
            return '';
        $str[0] = strtolower($str[0]);
        $func = create_function('$c', 'return "-" . $c[1];');
        $str = preg_replace_callback('/([A-Z])/', $func, $str);
        return ($strtolower) ? strtolower($str) : $str;
    }
public static function camelToHyphen ( $ str , $ strtolower = true ) { if ( ! is_string ( $ str ) ) return '' ; $ str [ 0 ] = strtolower ( $ str [ 0 ] ) ; $ func = create_function ( '$c' , 'return "-" . $c[1];' ) ; $ str = preg_replace_callback ( '/([A-Z])/' , $ func , $ str ) ; return ( $ strtolower ) ? strtolower ( $ str ) : $ str ; }
Turns camelCasedString to hyphened-string
@param string $str
@param boolean $strtolower
@return string
Turns camelCasedString to hyphened - string