You can loopthrough the array, castpass it to a string and add to new array, since this is only required for this case specific.
$a = [1, 3, 5, 7];
$b = array();
foreach($a as $as)
$b[] = (string)$as;
return $b;
Or is it better to use array_map()-
$a = array_map(function($value){
return (string) $value;
}, $a);
source
share