Hello,
I've got multiple variables that are all an array. I set them up like:
$round1 = ...;
$round2 = ...;
$round3 = ...;
All the way up to 10, now I created this:
$numbers = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10");
$rounds = array("round1", "round2", "round3", "round4", "round5", "round6", "round7", "round8", "round9", "round10");
for($i = 1; $i < 11; $i++) {
$newi = str_replace($numbers, $rounds, $i);
echo $newi."<br />";
}
Sadly this is only working partially, the output is:
round1
round2
round3
round4
round5
round6
round7
round8
round9
roundround10
Does anybody know why? If I make it "$i = 0;" the result is:
roundroundroundroundroundroundroundroundroundround10
roundroundroundroundroundroundroundroundround10
roundroundroundroundroundroundroundround10
roundroundroundroundroundroundround10
roundroundroundroundroundround10
roundroundroundroundround10
roundroundroundround10
roundroundround10
roundround10
round10
I'm kinda stuck here. Is it because I'm trying to replace numbers?
Regards,
Chris