public static function toSnakeCase($string) { return preg_replace('/([a-z])([A-Z])/s', '$1_$2', $string); }