Array assembly problem

I have two arrays of indefinite length arr1 and arr2 . Want to assemble a new array res

clipboard.png

Dec.29,2021

not very good at php. It should be universal in js.

var arr1 = [1,2,3];
            var arr2 = ['a','b','c','d'];
            var arr = [];
            arr1.forEach(i=>{
                arr2.forEach(j=>{
                    arr.push([i,j]);
                })
            })
            console.log(arr)

for

$a = [1,2,3];
$b = ['a','b','c','d'];

$res = [];
for($i = 0; $i < count($a); $iPP)
{
    for($j = 0; $j < count($b); $jPP)
    {
        $res[] = [$a[$i],$b[$j]];
    }
}
var_dump($res);
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37023-2c077.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37023-2c077.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?