public static function flattenAssoc(
    array $kvArray,
    /*string*/ $kField,
    /*string|boolean*/ $vField
  ) {
    $array = [];
    if(!empty($kvArray) && self::isAssoc($kvArray)) {
      foreach($kvArray as $k => $v) {
        $row = [];
        if(is_string($vField)) {
          $row[$vField] = $v;
        } else if(true === $vField && self::isAssoc($v)) {
          // Merge associative array values into row.
          $row = array_merge($row, $v);
        }
        $row[$kField] = $k;
        $array[] = $row;
      }
    }
    return $array;
  }