LaravelBook\Laravel4Powerpack\Str::snake PHP Method

snake() public static method

Convert a string to snake case.
public static snake ( string $value, string $delimiter = '_' ) : string
$value string
$delimiter string
return string
    public static function snake($value, $delimiter = '_')
    {
        $replace = '$1' . $delimiter . '$2';
        return ctype_lower($value) ? $value : strtolower(preg_replace('/(.)([A-Z])/', $replace, $value));
    }