public static function to_excel(array $data, string $file, bool $with_titles = true): bool
  {
    $checked = false;
    $todo = [];
    foreach ( $data as $d ){
      if ( !$checked && self::is_assoc($d) ){
        if ( $with_titles ){
          $line1 = [];
          $line2 = [];
          foreach ( $d as $k => $v ){
            $line1[] = $k;
            $line2[] = '';
          }
          $todo[] = $line1;
          $todo[] = $line2;
        }
        $checked = true;
      }
      $todo[] = array_values($d);
    }
    if ( count($todo) ){
      $objPHPExcel = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
      $objPHPExcel->getActiveSheet()->fromArray($todo, NULL, 'A1');
      $objPHPExcel
        ->getDefaultStyle()
        ->getNumberFormat()
        ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_TEXT);
      $ow = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($objPHPExcel);
      $ow->save($file);
      return \is_file($file);
    }
    return false;
  }