I have the following code in PHP where I declare my variables inside an array, what I am looking for is to make a loop where I can generate the configuration depending on the number of "apples" selected, where I have not been able to advance is in making the variable increase its number, that is to say that it goes according to $i PHP:
$_['appleNum'] = 5;
$_['appleBrand1'] = "a";
$_['appleState1'] = "aa";
$_['appleBrand2'] = "b";
$_['appleState2'] = "bb";
$_['appleBrand3'] = "c";
$_['appleState3'] = "cc";
$_['appleBrand4'] = "d";
$_['appleState4'] = "dd";
$_['appleBrand5'] = "e";
$_['appleState5'] = "ee";
for ($i = 1; $i <= $_['appleNum']; $i++) {
$_['appleConfig'] = "edit APPLE" . $i . "
set brand " . $_['appleBrand#'] . "
set state " . $_['appleState#'] .;
}