╰┈➤ array_fill_keys() function fills an array with values, specifying keys.
function arrayFillKeys($array) {
    print_r($array);
    $array = array_fill_keys($array, 'value');
    return ($array);
}
print_r(arrayFillKeys([4,3,2]));
// testing print_r outputs: ( [0] => 4, [1] => 3, [2] => 2 ) // The function returns: ( [4] => value, [3] => value, [2] => value )
by Luka Khitaridze
2 years ago
PHP
Functions
0
Pro tip: use ```triple backticks around text``` to write in code fences