$z = [$a, $b, $c, $d, $e, $f];
for ($i = 0; $i < count($z); $z[$i]='<span>'.$z[$i].'</span>', $i++);
nebo s foreach je to:
$z = [$a, $b, $c, $d, $e, $f];
foreach($z as $key=>$val){
$z[$key] = '<span>'.$val.'</span>';
}
$z = [$a, $b, $c, $d, $e, $f];
for ($i = 0; $i < count($z); $z[$i]='<span>'.$z[$i].'</span>', $i++);
nebo s foreach je to:
$z = [$a, $b, $c, $d, $e, $f];
foreach($z as $key=>$val){
$z[$key] = '<span>'.$val.'</span>';
}