I have a little php code that queries a database and then writes the record to a flat text file. Works fine. But I have it comma delimited... after each field it inserts a comma.
I need to have this fixed width. In other words, can PHP somehow know how long the field is in the DB, and write out the data that is in the field, and also pad the rest with spaces if needed?
Or will I have to check each line and determine the length, and if it's not a certain length will I have to write the number of spaces needed to fill it all out? That sounds like a pain in the rear.
Thanks.