From e89b70c3fbb41a893712e468462fe68ac305a738 Mon Sep 17 00:00:00 2001 From: Dai Date: Wed, 7 May 2025 16:02:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0check=5Fchinese=5Fchars?= =?UTF-8?q?=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/functions.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/functions.php b/app/functions.php index 1eb86a0..5455c4c 100644 --- a/app/functions.php +++ b/app/functions.php @@ -119,3 +119,12 @@ if(!function_exists('is_time_cross')){ return $checkCross(0, $timePeriods); // 从第一个时间段开始检查 } } + +//写一个检测字符串是否包含中文的函数 +if(!function_exists('check_chinese_chars')){ + function check_chinese_chars($str){ + return preg_match('/[\x{4e00}-\x{9fa5}]/u', $str); + } +} + +