I'm trying to make a multiform wardrobe builder I have a session variable for the number of doors the user selected in the previous page (1-6 doors). Based on the number of doors selected I am displaying default doors(i.e no type of door range selected) using a for loop. My issue is that I want each door to have a unique variable and turn these into session variables (to use further in the application) such as door1, door2 and door3 if 3 doors are selected. The idea is for these doors to be unique so the user can click and highlight the door 1 default image and populate that area/image with an image from the list of door ranges. Fairly new to this so any help would be greatly appreciated
code:
<?php
$myDoors = array();
for ($x = 1; $x <= $selected_doors; $x++) {
echo "Door: $x <br>";
$myDoors["Door$x"] = "value set in loop";
//if you want to loop through them all
foreach ($myDoors as $key => $val) {
echo "$key -> $val\n";
}
if ($selectRanges == 'Minimalist') { ?>
<div>
<img src="images/defaultMinimalist.png" alt="image">
</div>
<?php } elseif ($selectRanges == 'Classic') { ?>
<div>
<img src="images/defaultClassic.png" alt="image">
</div>
<?php } else { ?>
<div>
<img src="images/defaultEllipse.png" alt="image">
</div>
<?php }
} ?>