<?php function groupByOwners(array $files) : array { return []; } $files = array ( "Input.txt" => "Randy", "Code.py" => "Stan", "Output.txt" => "Randy" ); var_dump(groupByOwners($files)); code example
Example: Implement a groupByOwners function that: Accepts an associative array
function groupByOwners(array $files) : array
{
$result = [];
foreach($files as $file => $owner) {
$result[$owner][] = $file;
}
return $result;
}