<?php
$num1=array(1,2,3,4,5,6,7,8,9,10);
echo '<b>the array :</b>';
foreach($num1 as $num)
{
echo ' '.$num;
}
$string = join(',', $num1);
echo '<br><b>the string :</b>'.$string;
?>
output :
the array : 1 2 3 4 5 6 7 8 9 10
the string :1,2,3,4,5,6,7,8,9,10
$num1=array(1,2,3,4,5,6,7,8,9,10);
echo '<b>the array :</b>';
foreach($num1 as $num)
{
echo ' '.$num;
}
$string = join(',', $num1);
echo '<br><b>the string :</b>'.$string;
?>
output :
the array : 1 2 3 4 5 6 7 8 9 10
the string :1,2,3,4,5,6,7,8,9,10