如何将一个数字字符串数组转化为数字整数数组?

foreach($arr as $index => $value){
        $arr[$index] = (int)$value;
}

  采用循环遍历的方式,将数组中的每一个数字字符串元素设置为整数数字。

posted @ 2020-04-12 11:16  niushuangmeng  阅读(2151)  评论(0编辑  收藏  举报