Here is the .html (xml) document online: http://www.ika.timberpro.net/test/fajlok/001b.html
Here is the code:
Code: Select all
<?php
/**
* @author Gabika
* @copyright 2010
*/
if ($handle = opendir('fajlok/')) {
$i=0;
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$file_handle = fopen("fajlok/".$file, "r");
$file_contents = fread($file_handle, filesize('fajlok/'.$file));
$array[$i]=explode("<li class=\"name\">"."<span class=\"textLabel\">"."Név: </span>", $file_contents);
for($j=0; $j<count($array[$i]); $j++) {
$temp=explode("</li>", $array[$i][$j]);
$array[$i][$j]=$temp[0];
}
fclose($file_handle);
$array[$i][0]="";
$i++;
}
}
closedir($handle);
}
for($k=0; $k<count($array); $k++){
for($l=1; $l<count($array[$k]); $l++){
echo "$l ".$array[$k][$l]."<br/>";
}
}
if ($handle = opendir('fajlok/')) {
$i=0;
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$file_handle = fopen("fajlok/".$file, "r");
$file_contents = fread($file_handle, filesize('fajlok/'.$file));
$array[$i]=explode("<li class=\"citylevel\">"."<span class=\"textLabel\">"."Város mérete: </span>", $file_contents);
for($j=0; $j<count($array[$i]); $j++) {
$temp=explode("</li>", $array[$i][$j]);
$array[$i][$j]=$temp[0];
}
fclose($file_handle);
$array[$i][0]="";
$i++;
}
}
closedir($handle);
}
for($k=0; $k<count($array); $k++){
for($l=1; $l<count($array[$k]); $l++){
echo "$l ".$array[$k][$l]."<br/>";
}
}
if ($handle = opendir('fajlok/')) {
$i=0;
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$file_handle = fopen("fajlok/".$file, "r");
$file_contents = fread($file_handle, filesize('fajlok/'.$file));
$array[$i]=explode("<li class=\"owner\">"."<span class=\"textLabel\">"."Játékos: </span>", $file_contents);
for($j=0; $j<count($array[$i]); $j++) {
$temp=explode("</li>", $array[$i][$j]);
$array[$i][$j]=$temp[0];
}
fclose($file_handle);
$array[$i][0]="";
$i++;
}
}
closedir($handle);
}
for($k=0; $k<count($array); $k++){
for($l=1; $l<count($array[$k]); $l++){
echo "$l ".$array[$k][$l]."<br/>";
}
}
if ($handle = opendir('fajlok/')) {
$i=0;
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$file_handle = fopen("fajlok/".$file, "r");
$file_contents = fread($file_handle, filesize('fajlok/'.$file));
$array[$i]=explode("<li class=\"name\">"."<span class=\"textLabel\">"."Pontok: </span>", $file_contents);
for($j=0; $j<count($array[$i]); $j++) {
$temp=explode("</li>", $array[$i][$j]);
$array[$i][$j]=$temp[0];
}
fclose($file_handle);
$array[$i][0]="";
$i++;
}
}
closedir($handle);
}
for($k=0; $k<count($array); $k++){
for($l=1; $l<count($array[$k]); $l++){
echo "$l ".$array[$k][$l]."<br/>";
}
}
if ($handle = opendir('fajlok/')) {
$i=0;
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$file_handle = fopen("fajlok/".$file, "r");
$file_contents = fread($file_handle, filesize('fajlok/'.$file));
$array[$i]=explode("<li class=\"ally\">"."<span class=\"textLabel\">"."Szövetség: </span>", $file_contents);
for($j=0; $j<count($array[$i]); $j++) {
$temp=explode("</li>", $array[$i][$j]);
$array[$i][$j]=$temp[0];
}
fclose($file_handle);
$array[$i][0]="";
$i++;
}
}
closedir($handle);
}
for($k=0; $k<count($array); $k++){
for($l=1; $l<count($array[$k]); $l++){
echo "$l ".$array[$k][$l]."<br/>";
}
}
?>I want to use a separate file for storing connect details.
Best Regards,
Gabor