public static function indexArrayByValue($input, $value)
    {
        $output = [];
        foreach ($input as $row) {
            $output[$row->$value] = $row;
        }

        return $output;
    }
public static function indexArrayByValue($input, $value)
    {
        $output = [];
        foreach ($input as $row) {
            $output[$row->$value] = $row;
        }

        return $output;
    }
public static function indexArrayByValue ( $ input , $ value ) { $ output = [ ] ; foreach ( $ input as $ row ) { $ output [ $ row -> $ value ] = $ row ; } return $ output ; }
Reindex an existing array by a value from the array.

@param $input
@param $value

@return array
Reindex an existing array by a value from the array .