Commit 8d2272dc authored by 王源's avatar 王源 🎧

添加去除两边带全角空格的字符串方法

parent b4fc60a5
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
"ext-redis": "*", "ext-redis": "*",
"ext-gd": "*", "ext-gd": "*",
"ext-curl": "*", "ext-curl": "*",
"ext-mbstring": "*",
"hyperf/cache": "~1.1.0", "hyperf/cache": "~1.1.0",
"hyperf/framework": "~1.1.0", "hyperf/framework": "~1.1.0",
"hyperf/db-connection": "~1.1.0", "hyperf/db-connection": "~1.1.0",
......
...@@ -754,7 +754,16 @@ if (!function_exists('to_camel_case')) { ...@@ -754,7 +754,16 @@ if (!function_exists('to_camel_case')) {
} }
} }
if (!function_exists('mb_trim')) {
/**
* 去除两边带全角空格的字符串
* @param $str
* @return string
*/
function mb_trim($str)
{
mb_regex_encoding('utf-8');
$str = mb_ereg_replace(' ', '', $str);
return trim($str);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment