Total Complexity | 10 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
4 | class Str |
||
5 | { |
||
6 | public static function uFirst($str) |
||
9 | } |
||
10 | |||
11 | public static function buildParams($params, $urlencode = false, $except = ['sign']) |
||
12 | { |
||
13 | $param_str = ''; |
||
14 | foreach ($params as $k => $v) { |
||
15 | if (in_array($k, $except)) { |
||
16 | continue; |
||
17 | } |
||
18 | $param_str .= $k . '='; |
||
19 | $param_str .= $urlencode ? rawurlencode($v) : $v; |
||
20 | $param_str .= '&'; |
||
21 | } |
||
22 | return rtrim($param_str, '&'); |
||
23 | } |
||
24 | |||
25 | public static function random($length = 16) |
||
26 | { |
||
27 | $str_pol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"; |
||
28 | return substr(str_shuffle($str_pol), 0, $length); |
||
29 | } |
||
30 | |||
31 | public static function getClientIP() |
||
40 | } |
||
41 | } |
||
42 |