修改类库
This commit is contained in:
@@ -1 +1,24 @@
|
||||
<?php
|
||||
namespace catcher;
|
||||
|
||||
use think\helper\Str;
|
||||
|
||||
class Utils
|
||||
{
|
||||
/**
|
||||
* 字符串转换成数组
|
||||
*
|
||||
* @time 2019年12月25日
|
||||
* @param string $string
|
||||
* @param string $dep
|
||||
* @return array
|
||||
*/
|
||||
public static function stringToArrayBy(string $string, $dep = ','): array
|
||||
{
|
||||
if (Str::contains($string, $dep)) {
|
||||
return explode($dep, trim($string, $dep));
|
||||
}
|
||||
|
||||
return [$string];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user