src/Filter/Filters.php
public static function snakeCase($val, string $sep = '_'): string
    {
        if (!$val || !\is_string($val)) {
            return '';
        }

        $val = \preg_replace('/([A-Z][a-z])/', $sep . '$1', $val);

        return self::lowercase(\trim($val, $sep));
    }
public static function snakeCase($val, string $sep = '_'): string
    {
        if (!$val || !\is_string($val)) {
            return '';
        }

        $val = \preg_replace('/([A-Z][a-z])/', $sep . '$1', $val);

        return self::lowercase(\trim($val, $sep));
    }
public static function snakeCase ( $ val , string $ sep = '_' ) : string { if ( ! $ val || ! \ is_string ( $ val ) ) { return '' ; } $ val = \ preg_replace ( '/([A-Z][a-z])/' , $ sep . '$1' , $ val ) ; return self :: lowercase ( \ trim ( $ val , $ sep ) ) ; }
Transform a CamelCase string to underscore_case string
'CMSCategories' => 'cms_categories'
'RangePrice' => 'range_price'
@param string $val
@param string $sep
@return string
Transform a CamelCase string to underscore_case string CMSCategories = > cms_categories RangePrice = > range_price