I have 200 boxes of which to be named from an array. All names go sequentially and will restart from the first value in the array once previous Box has taken the last name (maximum value?) from the array.
$BoxName = array (Name1, Name2, Name3, Name4, Name5);
The name of first box is always determined by Users through their inputs. The rest of other boxes through coding.
Now i'm using very untrained approach: If Box1 = Name3, given by User's input:
Box1 = Name3 //given by the user
$BoxName = array (Name1, Name2, Name3, Name4, Name5);
$a = 3; //This is given by the User
$b = $a + 1;
if ( $b <= 5 ) {
$c = $a + 1;
} else {
$c = 1;
}
$d = $c + 1;
if ( $d <= 5 ) {
$e = $c + 1;
} else {
$e = 1;
}
echo $Box1 = $BoxName [3]; // this is given by the user
echo $Box2 = $BoxName [$c];
echo $Box3 = $BoxName [$e];
// ... ... and the list goes on for another 197 boxes.
?>
It obviously looks messy, incorrect and dirty. As a non IT trained dummy, this is the best i can achieve.