项目作者: Hemant-Mann

项目描述 :
Export data to .txt, .csv, .docx, .odt, .xml format using this library
高级语言: PHP
项目地址: git://github.com/Hemant-Mann/PHPExport.git
创建时间: 2015-06-29T17:25:57Z
项目社区:https://github.com/Hemant-Mann/PHPExport

开源协议:MIT License

下载


PHPExport

Description

It is library built in PHP to export data from the database to MSWord, ODT, and XML files.
The process to make docx and odt files is tricky but with a little help it can be understood

Setup

  1. git clone https://github.com/Hemant-Mann/PHPExport.git
  2. # Linux users you need to install 'php5-xsl' extension to export data in WORD Files
  3. sudo apt-get install php5-xsl # For Ubuntu Users
  • Import the examples/includes/products.sql into your local database.
  • Setup credentials in examples/includes/db.php
  • Below is a test code. Run in browser. (More usage see ‘examples’)
  1. <?php
  2. require_once 'Exporter.php'; // autoloader
  3. require_once 'examples/includes/products_mysqli.php';
  4. try {
  5. // pass custom options for downloading
  6. $options['suppress'] = 'image';
  7. $options['labelcase'] = 'strtoupper';
  8. new Text($result, 'products.txt', $options); // this will output the download file
  9. // named 'products.txt'
  10. } catch (Exception $e) {
  11. $error = $e->getMessage();
  12. }