<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ```php <?php // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK IT ] // +---------------------------------------------------------------------- // | Copyright (c) 2006-2015 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: yunwuxin <448901948@qq.com> // +---------------------------------------------------------------------- class Str { protected static $snakeCache = []; protected static $camelCache = []; protected static $studlyCache = []; /** * 檢查字符串中是否包含某些字符串 * @param string $haystack * @param string|array $needles * @return bool */ public static function contains(string $haystack, $needles): bool { foreach ((array) $needles as $needle) { if ('' != $needle && mb_strpos($haystack, $needle) !== false) { return true; } } return false; } /** * 檢查字符串是否以某些字符串結尾 * * @param string $haystack * @param string|array $needles * @return bool */ public static function endsWith(string $haystack, $needles): bool { foreach ((array) $needles as $needle) { if ((string) $needle === static::substr($haystack, -static::length($needle))) { return true; } } return false; } /** * 檢查字符串是否以某些字符串開頭 * * @param string $haystack * @param string|array $needles * @return bool */ public static function startsWith(string $haystack, $needles): bool { foreach ((array) $needles as $needle) { if ('' != $needle && mb_strpos($haystack, $needle) === 0) { return true; } } return false; } /** * 獲取指定長度的隨機字母數字組合的字符串 * * @param int $length * @param int $type * @param string $addChars * @return string */ public static function random(int $length = 6, int $type = null, string $addChars = ''): string { $str = ''; switch ($type) { case 0: $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' . $addChars; break; case 1: $chars = str_repeat('0123456789', 3); break; case 2: $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' . $addChars; break; case 3: $chars = 'abcdefghijklmnopqrstuvwxyz' . $addChars; break; case 4: $chars = "們以我到他會作時要動國產的一是工就年階義發成部民可出能方進在了不和有大這主中人上為來分生對于學下級地個用同行面說種過命度革而多子后自社加小機也經力線本電高量長黨得實家定深法表著水理化爭現所二起政三好十戰無農使性前等反體合斗路圖把結第里正新開論之物從當兩些還天資事隊批點育重其思與間內去因件日利相由壓員氣業代全組數果期導平各基或月毛然如應形想制心樣干都向變關問比展那它最及外沒看治提五解系林者米群頭意只明四道馬認次文通但條較克又公孔領軍流入接席位情運器并飛原油放立題質指建區驗活眾很教決特此常石強極土少已根共直團統式轉別造切九你取西持總料連任志觀調七么山程百報更見必真保熱委手改管處己將修支識病象幾先老光專什六型具示復安帶每東增則完風回南廣勞輪科北打積車計給節做務被整聯步類集號列溫裝即毫知軸研單色堅據速防史拉世設達爾場織歷花受求傳口斷況采精金界品判參層止邊清至萬確究書" . $addChars; break; default: $chars = 'ABCDEFGHIJKMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz23456789' . $addChars; break; } if ($length > 10) { $chars = $type == 1 ? str_repeat($chars, $length) : str_repeat($chars, 5); } if ($type != 4) { $chars = str_shuffle($chars); $str = substr($chars, 0, $length); } else { for ($i = 0; $i < $length; $i++) { $str .= mb_substr($chars, floor(mt_rand(0, mb_strlen($chars, 'utf-8') - 1)), 1); } } return $str; } /** * 字符串轉小寫 * * @param string $value * @return string */ public static function lower(string $value): string { return mb_strtolower($value, 'UTF-8'); } /** * 字符串轉大寫 * * @param string $value * @return string */ public static function upper(string $value): string { return mb_strtoupper($value, 'UTF-8'); } /** * 獲取字符串的長度 * * @param string $value * @return int */ public static function length(string $value): int { return mb_strlen($value); } /** * 截取字符串 * * @param string $string * @param int $start * @param int|null $length * @return string */ public static function substr(string $string, int $start, int $length = null): string { return mb_substr($string, $start, $length, 'UTF-8'); } /** * 駝峰轉下劃線 * * @param string $value * @param string $delimiter * @return string */ public static function snake(string $value, string $delimiter = '_'): string { $key = $value; if (isset(static::$snakeCache[$key][$delimiter])) { return static::$snakeCache[$key][$delimiter]; } if (!ctype_lower($value)) { $value = preg_replace('/\s+/u', '', $value); $value = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1' . $delimiter, $value)); } return static::$snakeCache[$key][$delimiter] = $value; } /** * 下劃線轉駝峰(首字母小寫) * * @param string $value * @return string */ public static function camel(string $value): string { if (isset(static::$camelCache[$value])) { return static::$camelCache[$value]; } return static::$camelCache[$value] = lcfirst(static::studly($value)); } /** * 下劃線轉駝峰(首字母大寫) * * @param string $value * @return string */ public static function studly(string $value): string { $key = $value; if (isset(static::$studlyCache[$key])) { return static::$studlyCache[$key]; } $value = ucwords(str_replace(['-', '_'], ' ', $value)); return static::$studlyCache[$key] = str_replace(' ', '', $value); } /** * 轉為首字母大寫的標題格式 * * @param string $value * @return string */ public static function title(string $value): string { return mb_convert_case($value, MB_CASE_TITLE, 'UTF-8'); } } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看