im working on a formatter...
It is for an online game that i play, where you see a screen that tells you, how good you are, ect. It is called a "clear sight"
This is what my screen looks like...
The Dominion of One Man Army (# 255)
Ruler: Lord Sven
Race: Wood Elf
Now.. i think to myself, how would i be able to make this information... and make it into something usefull...
So this is what i am thinking..
<form method="POST" action="calculate.php">
<textarea rows="2" name="input" cols="20">
<input type="submit" value="Submit" name="submit">
SAVE THE FILE
// This Clearsite will be saved to
$filename = "CS/1.php";
// Handle to open the file and in what mode
// The input will be given the variable name post
// Opens the file then writes the Clear sight in.
// close the clearsight
Read And Manipulate Data
This is where i am stumped, i need a way to get the information i need out of the inputed data..
$Province_name= "One Man Army (# 255)";
$ruler= "Lord Sven";
$race= "Wood Elf";
Now i know i can use substr() to get the info i want,
what i was wondering, is there any way i could search 5 lines down and go,
$race= substr(stuff on this line ,6);
im pretty confused, if anyone could help me that would be great
I can't say I completely understand what you're trying to do, but I can tell you it would be much easier to do with a database.
Failing that, try the file() function, which lets you read a file into a PHP array, with each element in the array being the contents of a line in the file. Thus, the 5th line of the file can be accessed as arrayName.