Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
<?php
$x = [
'А' => '1',
'B' => '2',
'C' => '3',
'D' => '4'
];
$y['A'] = array_shift($x);
$y['B'] = implode('#', $x);
?>
$x = [
'А' => '1',
'B' => '2',
'C' => '3',
'D' => '4'
];
function magic($x)
{
$k = array_keys($x);
$v = array_shift($x);
return [$k[0] => $v, $k[1] => implode('#', $x)];
}
print_r(magic($x));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question