0
Colleagues.
I have the following result from the bank:
Questions: 1,2,3 Answers: A,B,C
I would like it to be as follows:
1 - A; 2 - B; 3 - C;
I tried to use two foreach, but he’s repeating:
1 - A; 1 - B; 2 - A; 2 - B;
I did it that way:
$explodeR = explode(",",$jmTurmas->Respostas;
$explodeQ = explode(",",$jmTurmas->Questoes);
foreach($explodeQ as $exQ){
foreach($explodeR as $exR){
echo $exQ. " - ".$exR."<br>";
}
}
It’s not easier for you to use a associative array?
– João Sobral