How can i remove text from values ? i like values of array to be numbers only.
$arr = Array(
'39' => Array(
'0' => '307'
),
'42' => Array(
'0' => '329ds',
'1' => '300'
)
);
$result = implode(",", array_filter(array_map(function($v){
return implode(",", array_filter($v));
}, $arr)));
echo $result;
//result: 307,329ds,300
i tried to add (int) on implode() and its working but returning only 2 numbers instead of 3 numbers
$arr = Array(
'39' => Array(
'0' => '307'
),
'42' => Array(
'0' => '329ds',
'1' => '300'
)
);
$result = implode(",", array_filter(array_map(function($v){
return (int)implode(",", array_filter($v));
}, $arr)));
echo $result;
//result: 307,329