How can the result of a function be assigned to a variable?

<?php
  $name = "stefen";
  $tel = "10795856";
  $motto = "If you shed tears when you miss the sun,then you would miss the stars";

  function totalLen(...$string){
    //=print_r($string);
    foreach ($string as $content) {
      echo strlen($content).",";
    }
  }

  $arrNum = totalLen($name,$tel,$motto);
  //totalLen($name,$tel,$motto)6,8,69$arrNum

  echo array_sum(array($arrNum));

what I want to achieve is that no matter how many variables are passed into the function, the sum of the length of all characters can be calculated automatically, but now there is no way to assign the result to the variable and ask for advice

Php
Mar.22,2021

function totalLen(...$string){
    $lens = [];
    foreach ($string as $content) {
      $lens[] = strlen($content);
    }
    reutrn $lens;
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38447-2b948.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38447-2b948.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?