I Need a Human Readable, Yet Parse-able Document Format

Posted by macinjosh on Stack Overflow See other posts from Stack Overflow or by macinjosh
Published on 2010-04-07T21:04:11Z Indexed on 2010/04/07 21:13 UTC
Read the original article Hit count: 301

Filed under:
|
|
|

I'm working on one of those projects where there are a million better ways to accomplish what I need but I have no choice and I have to do it this way. Here it is:

There is a web form, when the user fills it out and hits a submit a human readable text file is created using the form data. It looks like this:

field_1: value for field one

field_2: value for field two
more data for field two (field two has a newline in it!)

field3: some more data

My problem is this: I need to parse this text file back into the web form so that the user can edit it.

How could I, in a foolproof way, accomplish this? A database is not an option, I have to use these text files.

My Questions:

  • Is there a foolproof way to do this using the format in the example above?
  • What human readable format would work better (in other words I can change the format)
  • Human readable means that a non programmer could read it and know what is what.

This project uses PHP.

© Stack Overflow or respective owner

Related posts about php

Related posts about parse