<?php
$data = [
'username' => [
'3805120' => 5,
'3805121' => 7,
],
'login' => [
'3805120' => 9,
'3805121' => 11,
],
];
$result = array_merge_recursive(
array_combine(array_map(function($value) { return 'U'.$value; }, array_keys($data['username'])), $data['username']),
array_combine(array_map(function($value) { return 'U'.$value; }, array_keys($data['login'])), $data['login'])
);
$result = array_combine(
array_map(function($value) { return substr($value, 1); }, array_keys($result),
$result
);
var_dump($result);
- Output for 7.0.0 - 7.0.15, 7.1.0 - 7.1.1
- Parse error: syntax error, unexpected ';', expecting ',' or ')' in /in/TRTJM on line 21
Process exited with code 255.
preferences:
165.85 ms | 1399 KiB | 25 Q