Skip to content

Commit 2792177

Browse files
committed
update new function
1 parent 2a14e44 commit 2792177

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

laravel/app/Helper/functions.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,18 @@ function cacheTotalExcel($api_excel_id, $file_path, $flash = false)
6868
}
6969
}
7070
}
71+
72+
/**
73+
* 判断是否是中文名称
74+
*
75+
* @param $realname
76+
* @return int
77+
*/
78+
if (!function_exists('isName')) {
79+
function isName($name)
80+
{
81+
$name = str_replace('.', '', $name);
82+
$name = str_replace('·', '', $name);
83+
return preg_match('/^[\x{2E80}-\x{FE4F}]{2,16}$/u', $name);
84+
}
85+
}

0 commit comments

Comments
 (0)