Обучение #39

Merged
lopar merged 15 commits from maksym into dev 2023-01-23 11:45:10 +00:00
Showing only changes of commit 328e7483cd - Show all commits

View File

@ -0,0 +1,11 @@
<?php
namespace DarksLight2\Helpers;
class Str
{
public static function snakeCase($string): string
{
return strtolower(preg_replace(['/([a-z\d])([A-Z])/', '/([^_])([A-Z][a-z])/'], '$1_$2', $string));
}
}