I'm trying to loop through an array that I got from preg_match_all
result in order to create one string from all results.
Array looks like this:
print_r($matches[0]);
Array
(
[0] => Array
(
[0] => 8147
[1] => 3
)
[1] => Array
(
[0] => 8204
[1] => 20
)
)
And my code:
$found = count($matches[0]);
for ($i = 0; $i <= $found; $i++) {
$string = $matches[0][$i];
}
I would like to get result of $string
like this: 8147, 8204
How i can append $matches[0][0]
to $matches[0][1]
etc. in string variable using loop?