Jump to content

Modify Text files


locbtran

Recommended Posts

I figure out how to write all the entries from my database onto a text file.

header("Content-Type: text/plain");header("Content-Disposition: Attachment; filename=test.txt");header("Pragma: no-cache");exit;

How do I modify the text file??Each entries (or row) have 5 elements in it and there are multiple entries in my database.How do I write each elements follow by a comma onto a text file? Each row in the database would have a new line in my text file as well.tks

Link to comment
Share on other sites

I'm thinking of writing all my sql onto an array then use a loop to go through each element in the arrayBut how would I be able to break up each entries so I can put it into an arraySo a row can have let say 3 entries and each entries can have more then one word in it SQL Entries:Name | Age | CountryJohn Adam Smith | 37 | USASteve Jones | 22 | Canada Also, how do I know when I reach the end of the row, so I can add in a new line.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...