- array_push: documentation ( source)
- print_r: documentation ( source)
<?php
$colors = array( 'red', 'green' );
$color="";
foreach($colors as $value)
{
$j=1;
while($j <6)
{
if($j>1)
$value = $value."($j)";
array_push($color,$value);
$j++;
}
}
print_r($color);