猿问

如何将数组元素中的json数据打印为字符串

我有一个数组

数组( [0] => ["1","2","7","8","9"] )


我想喜欢那个


数组([0] => 1 [1] => 2 [2] => 7 [3] => 8 [4] => 9)


我尝试 foreach 循环


foreach($no_a as $key=>$val){ 


    foreach($val as $k=>$v){ 


        $newp_arr[] $v ;

    }

}


守着一只汪
浏览 105回答 1
1回答

慕田峪9158850

$result = $no_a[0];$new_result = array();for ($i=0; $i < 21 ; $i++) {&nbsp;&nbsp; &nbsp; # code...&nbsp; &nbsp; $num = $result[$i];&nbsp; &nbsp; if(is_numeric($num))&nbsp; &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp; $new_result[] = $result[$i];&nbsp; &nbsp; }}print_r($new_result);
随时随地看视频慕课网APP
我要回答