Новая фича с хэлперами
This commit is contained in:
parent
3f579afaed
commit
328e7483cd
11
_incl_data/class/DarksLight2/Helpers/Str.php
Normal file
11
_incl_data/class/DarksLight2/Helpers/Str.php
Normal 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));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user