Answer the question
In order to leave comments, you need to log in
Iterate over the elements of two arrays and output in a loop?
Good afternoon!
There are two arrays.
First with users:
array(3) {
[0]=>
array(2) {
["id"]=>
&string(2) "14"
["name"]=>
string(23) "Юрий"
}
[1]=>
array(2) {
["id"]=>
string(2) "50"
["name"]=>
string(25) "Мария"
}
[2]=>
array(3) {
["id"]=>
string(2) "49"
["name"]=>
string(25) "Сергей"
}
}
array(3) {
[0]=>
array(4) {
["id"]=>
string(3) "155"
["text"]=>
string(20) "Комментарий Сергея"
["article_id"]=>
string(2) "70"
["user_id"]=>
string(2) "49"
}
[1]=>
array(4) {
["id"]=>
string(3) "162"
["text"]=>
string(14) "Комментарий Маши"
["article_id"]=>
string(2) "70"
["user_id"]=>
string(2) "50"
}
[2]=>
array(4) {
["id"]=>
string(3) "163"
["text"]=>
string(49) "комментарий Юры"
["article_id"]=>
string(2) "70"
["user_id"]=>
string(2) "14"
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question