php reading files

Associate
Joined
4 Mar 2007
Posts
315
Location
United Kingdom
Ok so im not a php coder as such and still trying to learn new and challenging things, however i would like some help with what direction i should be going in.
I have a project of creating a php script that will read a file but not a standard .txt it is a .dmx file, now using the echo readfile("file.dmx"); is ok but i need to format this file.
Thing is the dmx is structured like this:

Code:
"Info"
{
"info" "int" "0"
}

How would i go about reading this with php as when i use the readfile function all i get is.
"info"{"info""int"0"}
which is all well and good but not when the .dmx file gets much bigger then its just a pure mess.
Any ideas people?
 
Ok just updated. Ive got the correct parts of a file displaying using the arrays.
PHP:
echo "line: ".$lines[15]."<br />";
How would i select what part of the array i want to display, as it's set up like:
Code:
"array15" "int" "0"
 
Back
Top Bottom