更新
This commit is contained in:
@@ -63,4 +63,19 @@ function get_client_ip($type = 0, $adv = false) {
|
||||
|
||||
function avatar($uid, $size = 'middle') {
|
||||
return request()->root(true) . '/static/common/images/default_avatar_' . $size . '.jpg';
|
||||
}
|
||||
|
||||
// 分析枚举类型配置值 格式 a:名称1,b:名称2
|
||||
function parse_config_attr($string) {
|
||||
$array = preg_split('/[,;\r\n]+/', trim($string, ",;\r\n"));
|
||||
if (strpos($string, ':')) {
|
||||
$value = array();
|
||||
foreach ($array as $val) {
|
||||
list($k, $v) = explode(':', $val);
|
||||
$value[$k] = $v;
|
||||
}
|
||||
} else {
|
||||
$value = $array;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
Reference in New Issue
Block a user