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
$m1 = [1 => 6, 8 => 11, 20 => 30, 33 => 35, 66 => 80];
$m = [0 => 5, 6 => 25, 26 => 28, 80 => 95];
$keys = array_keys($m);
$keys1 = array_keys($m1);
$values = array_values($m);
$values1 = array_values($m1);
$n = count($keys);
$n1 = count($keys1);
for($i = 0; $i < min($n, $n1); $i++){
$key = $keys[$i];
$key1 = $keys1[$i];
$value = $values[$i];
$value1 = $values1[$i];
$res[min($key, $key1)] = max($value, $value1);
}
print_r ($res);