Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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
";
  foreach ($saida as $s){
  	foreach ($s as $k => $v){
  		echo "{$v};";
	  }
	  echo "
";
  }
Comment

PREVIOUS NEXT
Code Example
Php :: phpunit repeat 
Php :: join cakphp 
Php :: wordpress get current logged in user 
Php :: php remove charictors from a string 
Php :: Laravel groupby date of created_at 
Php :: php current page url 
Php :: Laravel seed timestamps columns 
Php :: How To Clear Laravel.Log In Laravel? 
Php :: laravel check if field has changed 
Php :: php check for empty string 
Php :: Calculate the Difference Between Two Dates Using PHP 
Php :: global laravel request() 
Php :: wherein laravel 
Php :: Cross-site request forgery validation failed. Required param "state" missing from persistent data 
Php :: if browser url is having domain in it check using php 
Php :: Warning: mysqli_fetch_all() expects parameter 1 to be mysqli_result, bool given in C: ewxammphtdocslearnindex.php on line 11 
Php :: install phpUnit in php by composer 
Php :: how to loop array in laravel 
Php :: laravel get db connection info 
Php :: larevel version artisan 
Php :: laravel file size validation 
Php :: Fatal error: Cannot redeclare 
Php :: difference of two dates in seconds php 
Php :: php get total amount of days in month 
Php :: convert float to integer laravel 
Php :: wordpress hook add javascript 
Php :: Target class [Controller] does not exist. 
Php :: wordpress query multiple post ids 
Php :: php foreach 
Php :: laravel where not 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =