mirror of
https://github.com/claradex/nativegallery.git
synced 2024-11-15 11:39:07 +03:00
20 lines
277 B
PHP
20 lines
277 B
PHP
|
<?php
|
||
|
namespace App\Services;
|
||
|
|
||
|
use App\Services\GenerateRandomStr;
|
||
|
|
||
|
|
||
|
|
||
|
class Word
|
||
|
{
|
||
|
|
||
|
public static function strlen($word)
|
||
|
{
|
||
|
$len = strlen($word);
|
||
|
|
||
|
if (preg_match("/[\p{Cyrillic}]/u", $word)) {
|
||
|
$len /= 2;
|
||
|
}
|
||
|
return $len;
|
||
|
}
|
||
|
}
|