learner question: array(key,value)
Posted on 2005-03-26
I have flat files whose contents regularly move from one file to another or a different location in the same file or are deleted. The contents of those files could be compared to containers holding other containers, down from 1 to 5 levels and it is those containers that move or are deleted.
Are PHP arrays suitable to trace these containers through their key attribute? For example if one container moves to another file or to another position in the same file (another array or sub-array) can it keep its key automatically?
When moving, can a container's key and value be inserted in a precise location in another array or sub-array?
When saving files from arrays, can the keys be saved in one file and the values in another?
If PHP arrays are suitable, can you show me some example of code for this particular application?