随笔分类 -  php 数组处理集合

摘要:1 <?php 2 3 if (!function_exists('bcSum')) { 4 function bcSum($scale, ...$args): string 5 { 6 $result = '0.00'; 7 foreach ($args as $arg) { 8 $result 阅读全文
posted @ 2022-04-28 14:45 没事就更 阅读(102) 评论(0) 推荐(0)
摘要:$wifi_regions = array_unique($wifi_regions, SORT_REGULAR); 阅读全文
posted @ 2021-01-12 12:37 没事就更 阅读(735) 评论(0) 推荐(0)
摘要:$arr = array( array( 'user_id' => 100, 'goods_id' => 10, 'number' => 1, ), array( 'user_id' => 102, 'goods_id' => 10, 'number' => 1, ), array( 'user_i 阅读全文
posted @ 2020-09-09 16:00 没事就更 阅读(1303) 评论(0) 推荐(1)
摘要:如何把多维数组中的每个子数组合并成一个新数组 $result,有两个方法: $merged = call_user_func_array('array_merge', $result); 如果是 PHP 版本在 5.6 以上,可以使用 ... 操作符: $merged = array_merge(. 阅读全文
posted @ 2020-06-17 20:36 没事就更 阅读(1193) 评论(0) 推荐(0)
摘要:$tmp = strip_tags($model->content);$temLen = mb_strlen($tmp);return mb_substr($tmp,0,20,'utf-8').(($temLen>20)?'...':""); 阅读全文
posted @ 2020-04-21 11:46 没事就更 阅读(1407) 评论(0) 推荐(0)
摘要:public function run($params){ if(!empty($params['match_code'])){ $match_code = $params['match_code']; }else{ return $this->errorReturn(1000); } $resul 阅读全文
posted @ 2020-01-20 10:18 没事就更 阅读(617) 评论(0) 推荐(0)
摘要:$arr=[ array( 'name'=>'小坏龙', 'age'=>28 ), array( 'name'=>'小坏龙2', 'age'=>14 ), array( 'name'=>'小坏龙3', 'age'=>59 ), array( 'name'=>'小坏龙4', 'age'=>23 ), 阅读全文
posted @ 2019-10-25 16:12 没事就更 阅读(1439) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2019-02-18 10:41 没事就更 阅读(3) 评论(0) 推荐(0)