public static function snakeCase($value)
    {
        $key = $value;
        if (isset(static::$snakeCache[$key])) {
            return static::$snakeCache[$key];
        }

        $value = preg_replace('/\s+/', '', ucwords($value));
        $value = str_replace('-', '_', $value);
        $value = static::normalizeScreamingCase($value);
        return static::$snakeCache[$key] = strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $value));
    }
public static function snakeCase($value)
    {
        $key = $value;
        if (isset(static::$snakeCache[$key])) {
            return static::$snakeCache[$key];
        }

        $value = preg_replace('/\s+/', '', ucwords($value));
        $value = str_replace('-', '_', $value);
        $value = static::normalizeScreamingCase($value);
        return static::$snakeCache[$key] = strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $value));
    }
public static function snakeCase ( $ value ) { $ key = $ value ; if ( isset ( static :: $ snakeCache [ $ key ] ) ) { return static :: $ snakeCache [ $ key ] ; } $ value = preg_replace ( '/\s+/' , '' , ucwords ( $ value ) ) ; $ value = str_replace ( '-' , '_' , $ value ) ; $ value = static :: normalizeScreamingCase ( $ value ) ; return static :: $ snakeCache [ $ key ] = strtolower ( preg_replace ( '~(?<=\\w)([A-Z])~' , '_$1' , $ value ) ) ; }
Convert a value to snake_case.

@param  string $value
@return string
Convert a value to snake_case .