Hi All,
I am trying to nest a loop inside of an array, to simplify the array.
IE
The end result I want is ...
$HowManyYrs = array("" => " ", "1" => "1", "2" => "2", "3" => "3", "4" => "4", "5" => "5", "6" => "6", "7+" => "7+");
and my 'attempt' is
$HowManyYrs = array("" => " ",
HowManyYrs .= "";
for($z = 1; $z <= 7; $z++) {
if($z=='7') {
$z='7+';
}
echo '"'.$z.'" => "'.$z.'",';
}
$HowManyYrs .= ")";
I know this is wrong, but I have tried several different approaches and non are correct.
I appreciate the help,
Don