<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Str; class StrUtil { public static function mask($EJXfL, $FgQaj = null, $utwRY = null, $RnbqY = '*') { goto PrP6L; ItRN7: if ($FgQaj < 0) { $FgQaj = 0; } goto cNakG; cNakG: if ($utwRY >= $NKk5D - 1) { $utwRY = $NKk5D - 1; } goto g2lz9; S8i40: $Qhkq8 .= str_repeat($RnbqY, $utwRY - $FgQaj + 1); goto CbESi; PrP6L: $NKk5D = mb_strlen($EJXfL); goto s1x1W; CbESi: if ($utwRY < $NKk5D - 1) { $Qhkq8 .= mb_substr($EJXfL, $utwRY + 1); } goto Lveac; Lveac: return $Qhkq8; goto TXOPo; s1x1W: if (null == $FgQaj) { $FgQaj = floor($NKk5D / 2); } goto XfEqr; XfEqr: if (null == $utwRY) { $utwRY = $FgQaj + floor($NKk5D / 2); } goto ItRN7; g2lz9: $Qhkq8 = ''; goto v9KXD; v9KXD: if ($FgQaj > 0) { $Qhkq8 .= mb_substr($EJXfL, 0, $FgQaj); } goto S8i40; TXOPo: } public static function passwordStrength($wX62V) { goto qhfQz; cX5Og: if (!empty($wX62V)) { $a5aLq++; } goto UZE4G; bJHOi: if (!empty($wX62V)) { $a5aLq++; } goto RAE2B; qhfQz: $a5aLq = 0; goto LrBF7; UZE4G: $wX62V = preg_replace('/[A-Z]+/', '', $wX62V); goto n763r; n763r: if (!empty($wX62V)) { $a5aLq++; } goto sisvO; sisvO: return $a5aLq; goto L32Cy; kyJAu: $wX62V = preg_replace('/\\d+/', '', $wX62V); goto bJHOi; LrBF7: if (!empty($wX62V)) { $a5aLq++; } goto kyJAu; RAE2B: $wX62V = preg_replace('/[a-z]+/', '', $wX62V); goto cX5Og; L32Cy: } public static function camelize($xJnq_, $l_kuy = '_') { $xJnq_ = $l_kuy . str_replace($l_kuy, ' ', strtolower($xJnq_)); return ltrim(str_replace(' ', '', ucwords($xJnq_)), $l_kuy); } public static function uncamelize($Y9S61, $l_kuy = '_') { return strtolower(preg_replace('/([a-z])([A-Z])/', '$1' . $l_kuy . '$2', $Y9S61)); } public static function startWith($uxnaQ, $Ten04) { foreach ((array) $Ten04 as $gE0h6) { if ($gE0h6 != '' && mb_strpos($uxnaQ, $gE0h6) === 0) { return true; } } return false; } public static function filterSpecialChars($FT9zA) { $SlIXj = array('​', '‌', '‍'); return str_replace($SlIXj, '', $FT9zA); } public static function limit($MLXrV, $qodot = 100, $ineBL = '...') { return Str::limit($MLXrV, $qodot, $ineBL); } public static function mbLimit($MLXrV, $qodot) { return Str::limit($MLXrV, $qodot, ''); } public static function mbLength($MLXrV) { if (empty($MLXrV)) { return 0; } return intval(mb_strwidth($MLXrV, 'UTF-8')); } public static function mbLengthGt($MLXrV, $qodot) { return self::mbLength($MLXrV) > $qodot; } }