$glue = ' '; $str = ''; $c = count($a); for($i = 0; $i < $c; $i++) { if($i != 3) $str .= $a[$i] . $glue; }