Michael W.: 2 schleifen ineinander (thread übernahme)

Beitrag lesen

Lies auch die Anmerkungen zu is_file() bei php.net und versuchs vielleicht auch mit file_exists().

die existiert auf jeden fall da wir das array mit einem echo geprüft hatten und ich habe auch eine

<?php
$verzeichnis = './server';
if($verzeichnis."/".$datei){
$dir=opendir($verzeichnis);
.
.
.
}
?>

abfrage gemacht.

dadran liegt es nicht.

hier nochmal das script und darauf folgend deren ausgabe:

script:
-------------------------

<?php
$verzeichnis = './server';
if($verzeichnis."/".$datei){
$dir=opendir($verzeichnis);
while ($file = readdir ($dir))
  if (!is_dir($datei)){
    $files[] = $file;
}
closedir($dir);
if (is_array($files)){
foreach($files as $handle)
{
$datei = file($verzeichnis."/".$handle);
print "<br><hr><I><b>Server:<U>".$handle."</b></I></U><hr><br>";
$a = "USER=";
$b = " Processor: ";
$c = " CPU Clock Speed: ";
$d = " Extended Memory: ";
$e = "Fixed Disk";
for($i=0;$i<count($datei);$i++)
{
if(eregi($b,$datei[$i])) $array[0][] = $datei[$i];
if(eregi($a,$datei[$i])) $array[1][] = $datei[$i];
if(eregi($e,$datei[$i])) $array[4][] = $datei[$i];
if(eregi($d,$datei[$i])) $array[3][] = $datei[$i];
if(eregi($c,$datei[$i])) $array[2][] = $datei[$i];
}
reset($array);
while(list($key,$val)=each($array[0])){
print "<b>";
echo $array[1][$key];
print "</b><br><br>";
echo $val;
print "<br>";
echo $array[2][$key];
print "<br>";
echo $array[3][$key];
print "<br>";
echo $array[4][$key];
print "<br><hr>";
}
print "<br><br>";
}
}
}
?>

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

ausgabe:
-----------------------------

Server:.

Warning: Variable passed to reset() is not an array or object in /usr/local/httpd/htdocs/rwzadm/menu/support/hardware/rwz-check.php on line 28

Warning: Variable passed to each() is not an array or object in /usr/local/httpd/htdocs/rwzadm/menu/support/hardware/rwz-check.php on line 29

Server:..

Warning: Variable passed to each() is not an array or object in /usr/local/httpd/htdocs/rwzadm/menu/support/hardware/rwz-check.php on line 29

Server:te-pfu01.log
USER=doerrre

Processor: Intel Pentium with MMX-201
CPU Clock Speed: 201 MHz
Extended Memory: 31 MB (31 MB Free)
C: 1222 MB 610 MB 612 MB Fixed Disk
USER=mausfr

Processor: Intel Pentium-133
CPU Clock Speed: 133 MHz
Extended Memory: 15 MB (15 MB Free)
C: 1220 MB 460 MB 760 MB Fixed Disk

Server:f-aac01.log

Server:te-kus01.log
USER=buchhoec

Processor: Intel Pentium-133
CPU Clock Speed: 133 MHz
Extended Memory: 15 MB (15 MB Free)
C: 2039 MB 737 MB 1302 MB Fixed Disk
USER=raddatge

Processor: Intel CeleronA-334
CPU Clock Speed: 334 MHz
Extended Memory: 31 MB (31 MB Free)
C: 2039 MB 1080 MB 959 MB Fixed Disk

Server:f-und01.log
USER=ammannth

Processor: Intel Celeron-268
CPU Clock Speed: 268 MHz
Extended Memory: 31 MB (31 MB Free)
C: 2039 MB 680 MB 1359 MB Fixed Disk
USER=beckerel

Processor: Cyrix Cx486DX2-80
CPU Clock Speed: 80 MHz
Extended Memory: 31 MB (31 MB Free)
C: 809 MB 227 MB 582 MB Fixed Disk
USER=gardtol

Processor: AMD Athlon(tm) (Thunderbird)-1041
CPU Clock Speed: 1041 MHz
Extended Memory: 127 MB (64 MB Free)
C: 19530 MB 818 MB 18 GB RWZ Fixed Disk
USER=hammenvo

Processor: Cyrix Cx486DX2-66
CPU Clock Speed: 66 MHz
Extended Memory: 31 MB (31 MB Free)
C: 813 MB 554 MB 259 MB Fixed Disk
USER=stellwuw

Processor: Intel Pentium-167
CPU Clock Speed: 167 MHz
Extended Memory: 31 MB (31 MB Free)
C: 1222 MB 628 MB 594 MB Fixed Disk
USER=wallicho

Processor: Intel Pentium-133
CPU Clock Speed: 133 MHz
Extended Memory: 15 MB (15 MB Free)
C: 1222 MB 628 MB 594 MB Fixed Disk
USER=zockca

Processor: Intel CeleronA-468
CPU Clock Speed: 468 MHz
Extended Memory: 31 MB (31 MB Free)
C: 8213 MB 2404 MB 5809 MB Fixed Disk

Server:f-wie01.log
USER=burkhagu

Processor: Intel CeleronA-501
CPU Clock Speed: 502 MHz
Extended Memory: 63 MB (63 MB Free)
C: 8040 MB 806 MB 7234 MB RWZ Fixed Disk
USER=jusekga

Processor: AMD Duron(tm)-834
CPU Clock Speed: 834 MHz
Extended Memory: 127 MB (64 MB Free)
C: 19530 MB 1095 MB 18 GB RWZ Fixed Disk
USER=kleinad

Processor: Intel Pentium-201
CPU Clock Speed: 201 MHz
Extended Memory: 31 MB (31 MB Free)
C: 809 MB 319 MB 490 MB Fixed Disk
USER=krausewe

Processor: AMD K6-2-402
CPU Clock Speed: 402 MHz
Extended Memory: 61 MB (61 MB Free)
C: 6138 MB 591 MB 5547 MB Fixed Disk
USER=kuboscpe

Processor: Intel Pentium with MMX-167
CPU Clock Speed: 167 MHz
Extended Memory: 31 MB (31 MB Free)
C: 2039 MB 1091 MB 948 MB Fixed Disk
USER=langch

Processor: AMD Athlon(tm) (undistinguished model)-1244
CPU Clock Speed: 1244 MHz
Extended Memory: 255 MB (64 MB Free)
C: 39070 MB 1503 MB 36 GB RWZ Fixed Disk
USER=ludwigha

Processor: AMD X5+ (Am5x86+)-133
CPU Clock Speed: 133 MHz
Extended Memory: 31 MB (31 MB Free)
C: 2039 MB 661 MB 1378 MB Fixed Disk
USER=maedrith

Processor: AMD Duron(tm)-834
CPU Clock Speed: 834 MHz
Extended Memory: 127 MB (64 MB Free)
C: 19530 MB 1381 MB 17 GB RWZ Fixed Disk
USER=mahrru

Processor: Intel Pentium-133
CPU Clock Speed: 133 MHz
Extended Memory: 31 MB (31 MB Free)
C: 2039 MB 556 MB 1483 MB Fixed Disk
USER=meininhe

Processor: Cyrix Cx486DX2-80
CPU Clock Speed: 80 MHz
Extended Memory: 31 MB (31 MB Free)
C: 1220 MB 385 MB 835 MB Fixed Disk
USER=mertenin

Processor: Intel CeleronA-335
CPU Clock Speed: 335 MHz
Extended Memory: 63 MB (63 MB Free)
C: 9529 MB 953 MB 8576 MB RWZ Fixed Disk
USER=produkt

Processor: Intel Pentium-167
CPU Clock Speed: 167 MHz
Extended Memory: 31 MB (31 MB Free)
C: 4094 MB 661 MB 3433 MB Fixed Disk
USER=riegelha

Processor: Intel Pentium-167
CPU Clock Speed: 167 MHz
Extended Memory: 31 MB (31 MB Free)
C: 2039 MB 820 MB 1219 MB Fixed Disk
USER=waltermn

Processor: Intel Pentium with MMX-201
CPU Clock Speed: 201 MHz
Extended Memory: 15 MB (15 MB Free)
C: 19460 MB 914 MB 18 GB RWZ Fixed Disk
USER=wienkehe

Processor: AMD Duron(tm)-834
CPU Clock Speed: 834 MHz
Extended Memory: 127 MB (64 MB Free)

Server:ra-kat01.log

Server:te-als01.log

Server:te-wet01.log
USER=blumenhe

Processor: Intel Pentium with MMX-201
CPU Clock Speed: 201 MHz
Extended Memory: 31 MB (31 MB Free)
C: 1619 MB 1122 MB 497 MB RWZ Fixed Disk
USER=kippkl

Processor: Intel Pentium-134
CPU Clock Speed: 134 MHz
Extended Memory: 47 MB (47 MB Free)
C: 1220 MB 1196 MB 24 MB Fixed Disk
USER=splettdi

Processor: Intel Pentium with MMX-201
CPU Clock Speed: 201 MHz
Extended Memory: 31 MB (25 MB Free)

Server:f-koe01.log
USER=ahlersmi

Processor: AMD Duron(tm)-946
CPU Clock Speed: 946 MHz
Extended Memory: 34 MB (64 MB Free)
C: 2047 MB 1440 MB 607 MB _ Fixed Disk
USER=altmanth

Processor: Intel CeleronA-431
CPU Clock Speed: 430 MHz
Extended Memory: 63 MB (63 MB Free)
D: 5997 MB 0 MB 5997 MB Fixed Disk
USER=arndthe

Processor: AMD Athlon(tm) (Thunderbird)-1041
CPU Clock Speed: 1041 MHz
Extended Memory: 127 MB (64 MB Free)
C: 19530 MB 704 MB 18 GB RWZ Fixed Disk
USER=at1azubi

Processor: Intel CeleronA-431
CPU Clock Speed: 431 MHz
Extended Memory: 63 MB (63 MB Free)
C: 2047 MB 816 MB 1231 MB Fixed Disk

.
.
.

und so weiter

Danke