PHP Export Class

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

PHP Export Class

Post by Todd_Z »

Has anyone seen a script that creates various export formats, specifically tab, csv, xml, html, sql?
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Re: PHP Export Class

Post by Roja »

Todd_Z wrote:Has anyone seen a script that creates various export formats, specifically tab, csv, xml, html, sql?
Tab and csv is relatively simple - you iterate over the array, and at each element, append a tab or a comma. Done.

XML and HTML are considerably more challenging. XML requires a valid parse tree, and HTML is.. well, a mess.

One library for all of those wouldn't make much sense.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

You could also use a Template class and templates for each export type. Just select the template for that type of export and loop through the data.
(#10850)
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

yea, i guess i'll just put together a lil class for it.
Post Reply