Answer the question
In order to leave comments, you need to log in
How to join all the values of two arrays into a string?
There are 2 arrays. It is necessary to glue all the values of the first array into a string with all the values of the second one.
For example
, 1 array: abc
2 array 1 2 3
The output should be a1 b1 c1 a2 b2 c2 a3 b3 c3
So far, nothing comes to mind except for two foreach.
Answer the question
In order to leave comments, you need to log in
yes, you can do that
$one = ["a","b","c"];
$two = ["1","2","3"];
foreach($one as $data) {
foreach($two as $data1) {
echo $data[0].$data1[0]."<br />";
}
}
So far, apart from two foreach, nothing comes to mind.
Just as an option to output through for loops double for if for
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question