I'm trying to make a parser for my files and I have a few questions.
First: I want the parser to output in this format
$array["first"]["second"]["third"]["etc."]
So for example
//My file
"Test"
{
"testKey"
{
"testVar""testValue"
}
}
//PHP
$arrays = Parse("file.txt");
echo $array["Test"]["testKey"]["testVar"];
//Returns
Test Value
Now I'm pretty sure i can do that, I've done it with Lua and theres only a few changes.
My question is can this be done easier with XML? Will I get the same result if i use either the DOM parser or expat?
And when i write this:
\"test\"\n
\"test2\"\n
to a file it returns
"test"[][]"test2"[]
in the .txt file itself. What escape characters should i use so that notepad will recognize the new lines. I mean, it doesn't really matter it just helps readability.