Jump to content

What is exporting .php file to other types of file extension?


lcy

Recommended Posts

Hello everyone! :)

 

In my current project, i'm reqiured to export the summary report to other types of file extension, including html, pdf, xls, txt, csv, ods and sxc. The problem is that i don't know a single thing about this file exporting.

 

Hope to get some information about file exporting here. And how should i start this task? Thanks in advance. Help is appreciated.

Link to comment
Share on other sites

You would simply use PHP to write to a file for most of those. See tutorial below. Based upon the file type you would prepare the data differently: e.g., a CSV file you would write as comma separated, and HTML file would have HTML tags, etc. Other file types, such as PDF, can be generated using PHPs build in PDF library or even third party tools. Then others may not have a direct PHP solution.

 

http://www.tizag.com/phpT/filewrite.php

Link to comment
Share on other sites

Thanks for info provided. But i still don't get how should i do this export thing. Is it i need to download some codes for exporting .php files to those required files options, link them to my codes and that will do ...or what? Sorry for not getting what you guys mean because i don't have any single concept of this.

Link to comment
Share on other sites

Did you read the tutorial I linked to? If you read that it should get you started. To export to any particular file type you will need to know the format of that file and write a file in that format. If you can't follow the tutorial to get the basics, I'm not sure how we can help you in a forum. If, however, you have specific questions about things int he tutorial, then by all means ask.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.