Kmspico Download | Official KMS Activator Website [New Version 2024] Uw betrouwbare online apotheek Drogisterij Unique in Nederland Vavada вход позволяет мгновенно попасть в мир азартных игр и бонусов! Получи доступ и начни выигрывать прямо сейчас.

Arr::crossJoin() use in Laravel 11.x

In Laravel 11, Arr::crossJoin() is used to compute the Cartesian product of multiple arrays. This means it combines elements from multiple arrays in all possible ways.

Syntax:

use Illuminate\Support\Arr;
$result = Arr::crossJoin($array1, $array2, $array3, ...);

Example: Cross Join Two Arrays

use Illuminate\Support\Arr;
$matrix = Arr::crossJoin([1, 2], ['a', 'b']);

/*
output:

[
[1, 'a'],
[1, 'b'],
[2, 'a'],
[2, 'b'],
]
*/

$matrix = Arr::crossJoin([1, 2], ['a', 'b'], ['I', 'II']);

/*
output:

[
[1, 'a', 'I'],
[1, 'a', 'II'],
[1, 'b', 'I'],
[1, 'b', 'II'],
[2, 'a', 'I'],
[2, 'a', 'II'],
[2, 'b', 'I'],
[2, 'b', 'II'],
]
*/