Answers for "php force download csv"

PHP
0

php force download csv

header('Content-Type: text/csv');
  header('Content-Disposition: attachment; filename="ramais.csv"');

  $saida = $stmt->fetchAll(PDO::FETCH_ASSOC);
  echo "id;nome;ramal;email;setor;diretor\r\n";
  foreach ($saida as $s){
  	foreach ($s as $k => $v){
  		echo "{$v};";
	  }
	  echo "\r\n";
  }
Posted by: Guest on March-03-2020

Browse Popular Code Answers by Language