function crossConcat(array $someArray, array $otherArray) {
$concatenated = [];
foreach ($someArray as $someArrayElement) {
foreach ($otherArray as $otherArrayElement) {
$concatenated[] = $someArrayElement . $otherArrayElement;
}
}
return $concatenated;
}
$sites = ["site.com/file.php", "site2.net/file.php", "site3.irg/file.php"];
$paramStrings = ["?123", "?abc", "?777"];
var_dump(crossConcat($sites, $paramStrings));
/*
array(9) {
[0]=>
string(21) "site.com/file.php?123"
[1]=>
string(21) "site.com/file.php?abc"
[2]=>
string(21) "site.com/file.php?777"
[3]=>
string(22) "site2.net/file.php?123"
[4]=>
string(22) "site2.net/file.php?abc"
[5]=>
string(22) "site2.net/file.php?777"
[6]=>
string(22) "site3.irg/file.php?123"
[7]=>
string(22) "site3.irg/file.php?abc"
[8]=>
string(22) "site3.irg/file.php?777"
}
*/