Total sum viewers for multiple users

My code fix removed the need for all_channels

if you don’t want to use that fix then

foreach($all_channels as $mydata){
$views     = $mydata['viewer_count'];
$viewss = (array)$views;
$viewsss = implode('+', (array)$views);
$totv = array_sum($viewsss);
}
echo $totv;

instead do

$total = 0;
foreach($all_channels as $mydata){
    $total += $mydata['viewer_count'];
}
echo $total;

Theres no need to do the weird array, implode and array_sum stuff you are doing