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)
Overview
Ruler: Lord Sven
Race: Wood Elf
Land: 2,863
Peasants: 35,509
Draftees: 0
Employment: 100%
Networth: 241,198
Resources
Platinum: 469
Food: 73,420
Lumber: 38,733
Mana: 11,284
Ore: 411
Gems: 0
Boats: 216
Military
Morale: 60%
Rangers: 0
Longbowmen: 0
Mystics: 15,604
Druids: 962
Spies: 5,175
Wizards: 0
ArchMages: 120

-------------

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..

PAGE 1
INPUT PAGE

<form method="POST" action="calculate.php">
<textarea rows="2" name="input" cols="20">
</textarea>
<input type="submit" value="Submit" name="submit">
</form>


PAGE 2
SAVE THE FILE

<?
// This Clearsite will be saved to
$filename = "CS/1.php";

// Handle to open the file and in what mode
$handle= fopen($filename,'a+');

// The input will be given the variable name post
$post ="$input";

// Opens the file then writes the Clear sight in.
fputs($handle, $post);

// close the clearsight
fclose($handle);

?>

PAGE 3
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