You are here: Human readable config files « PHP Programming Language « IT news, forums, messages
Human readable config files

Posted by Captain Dondo on 04/14/06 18:26

I am working on an embedded platform. Disk storage is at a premium, so
I am trying not to add any more stuff....

I am reading and writing some data that the user enters through a
webform. The form is an operations schedule for a piece of equipment.

Basically, the schedule consists of repeated actions by the machine, and
it is very simple:

%f %f %d %d %d %d %d

repeated about 10 or 15 times.

I will be storing the data in associative arrays, so I would like a
simple way to write the data in a format easily read by a human.

So, instead of the simple line of numbers, I would like something like this:

< Schedule
< Line
< From %f >
< To %f >
< Op1 true >
< Op2 true >
< Op3 false >
< Op4 true >
</ Line>
.... [more lines as needed]
</ Schedule>

I was thinking of XML, but it looks as though XML uses external libs and
is fairly complex to use in PHP....

Since the data is stored in an associative array basically using the
above structure, is there a way to dump an array to file and then read
it back?

Something like print_r, but using file ops and also a read_r to read it
into the array?

Bascially, I am looking for the simplest way to create something that
looks sort of like XML....

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация