Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Gábor Papp
Added: Sep 3, 2021 4:44 PM
Views: 278
Tags: no tags
  1. $lek="SELECT * FROM ".P."urlap_nyeremenyj_elektromos_2021 ".$where." ORDER BY datumido DESC";
  2. $list=$s_db->GetArray($lek);
  3. $filename='nissancentrum-elektromos-nyeremenyjatek-2021.xls';
  4. header("Content-Disposition: attachment; filename=\"".$filename."\"");
  5. header("Content-Type: application/vnd.ms-excel;charset=UTF-8");
  6. // $user_query = mysql_query('select name,work from info');
  7. // Write data to file
  8. $flag = false;
  9. // while ($row = mysql_fetch_assoc($user_query)) {
  10. echo  implode("\t", array_keys($list[0]))."\r\n";
  11. for ($i=0; $i<count($list); $i++) {
  12.     foreach ($list[$i] as $key=>$value) {
  13.         // $list[$i][$key]=utf8tohun($list[$i][$key]);
  14.         $list[$i][$key]=iconv('utf-8','ISO-8859-2',$list[$i][$key]);
  15.     }
  16.     echo implode("\t", array_values($list[$i])) . "\r\n";
  17. }