mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-18 13:14:52 +08:00
add implode_when_necessary global function
This commit is contained in:
parent
4702aa1987
commit
8335cfed69
@ -626,6 +626,18 @@ function zm_internal_errcode($code): string
|
||||
return "[ErrCode:{$code}] ";
|
||||
}
|
||||
|
||||
/**
|
||||
* 将可能为数组的参数转换为字符串
|
||||
*
|
||||
* 如传入字符串则为原样返回
|
||||
*
|
||||
* @param array|string $string_or_array
|
||||
*/
|
||||
function implode_when_necessary($string_or_array): string
|
||||
{
|
||||
return is_array($string_or_array) ? implode(', ', $string_or_array) : $string_or_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* 以下为废弃的函数,将于未来移除
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user