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
/*
#Запрос который отправляю
[{
"user_tg_id": "{{this_user.platform_id}}",
"user_points": "{{all_point}}"
}]
*/
<?php
$ar1 = [
0 => '2021-08-05',
7 => '2021-08-04',
13 => '2021-07-15',
26 => '2021-07-10'
];
$ar2 = [
0 => ['2021-08-05' => 3],
1 => ['2021-07-10' => 6]
];
$dates = array_reduce(
$ar2,
function($res, $el) {
$res[array_key_last($el)]=array_pop($el);
return $res;
},
[]
);
print_r($dates);