I wrote a php file like this to take some parts of this text files
server.dat file(which will be read by php)
channel15=Dragon Roost
channel16=Human Castle
channel17=Orc Stronghold
channel18=Undead Necropolis
channel19=Night Elf Tree of Life
channel20=Dragon Roost
channel21=Chat
channel22=Backstage
channel23=Moderated Support
channel24=-=Clan Ng)=-
channel25=-=[XOD] Clan=-
channel26=Turnuva
channel27=Toplantý salonu
channel28=[DarK] Klan
channel29=broodwar-1
[GAMES]
game1=nun
game2=GG
game3=2w2
game4=1w1
game5=11
game6=kek
[USERS]
user1=Avatar
user2=methodman
user3=Selehattin
user4=WanderleiSilva
user5=fult
user6=bularko
user7=cLem3nZa
user8=Sonic-tr
user9=ZoKo
user10=V-Power
user11=eliyen_1071
user12=eliyen_1453
user13=eSC)nOOOn
user14=ExistenT
user15=My_Boxer
user16=eSC)Arkansis
user17=cayenne
user18=adidas
user19=kekstra
user20=Ng)Jeobu(bgr
user21=ShamanOfDeath
<?
$oyundurum = "ilk";
$line = file("C:\\PvPGN\\var\\status\\server.dat");
$i=0;
foreach ($line as $line_num => $line) {
$i++;
}
for($j=0;$oyundurum="[USERS]";$j++) {
list($oyundurum, $acikoyun) = explode("=",$line[$j]);
if ($oyundurum == "[GAMES]") {
for($a=$j+1;$oyundurum="[USERS]";$a++) {
list($oyundurum, $acikoyun) = explode("=",$line[$a]);
echo "$acikoyun <br><br>";
exit;
}
}
}
?>
i want this php to take datas from [GAMES] part to [USERS] part(but lines are not static one time [GAMES] can be in line 15 another time it can be on line 20 or something else) but i couldnt do it
does anyone have any idea about how can i do it?