• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

PHPExcel_IOFactory::createWriter causes wrong behaviour

phpphpexcel


PHP Snippet 1:

07:31:12 Create new PHPExcel object 
07:31:12 Set properties 
07:31:12 Add some data 
07:31:12 Rename sheet 
07:31:12 Write to Excel2007 format 

PHP Snippet 2:

    $objWriter =  PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');

    header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
    header('Content-Disposition: attachment;filename="workbook1.xlsx"');
    header('Cache-Control: max-age=0');

    ob_end_clean();
    $objWriter->save('php://output');
    exit;

Related Snippets

Server-sent events in PHP (without echo or print)

Redirect to previous page with php

Woocommerce Edit Message "An account is already registered with your email address. Please log in."

Laravel views are showing from cache on one server but works fine on other server

Target class controller does not exist - Laravel 8

PHPUnit (Phar) Fatal Error Only When Test Fails

PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: no such host known

Creating command to backup MySql database in Laravel

Star rating with half star support

Get data from accuweather api url

Inserting Country Selection into MySQL PHP [duplicate]

image source not readable

array_map triple dimensional array [duplicate]

IlluminateDatabaseQueryException: SQLSTATE[HY000]: General error: 1 no such table - In clone project

PHP array sort and remove duplicates by two field values

About Contact Privacy policy Terms and conditions