Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$array1 = [1,2,3,4,5,6];
$array2 = [1,2,3,4,5];
for($i=0; $i<max(count($array1),count($array2)); $i++){
echo ($array1[$i]??'Пусто').' - '.($array2[$i]??'Пусто').PHP_EOL;
}