Не работает... :(
error_reporting(E_ALL);
chdir ("/home/DerAlSem/programs/fad");
$handle = popen('./server -list |grep -v Fin |grep -v Upl 2>&1', "r");
$read = fread($handle, 4192);
$clear_read = preg_replace("/\s+/", " ", $read);
pclose($handle);
$prestatus = explode(" ", $clear_read);
# generating working array
$x = 0;
$y = 0;
foreach ($prestatus as $value) {
if ( strstr($value,'.log') != FALSE) {
$y++;
$x = 0;
};
$x++;
$status['$x']['$y'] = '$value';
print "Key=[$x][$y], value = $status[$x][$y]";
};
Выдает:
Notice: Undefined offset: 1 in /home/DerAlSem/programs/apache/htdocs/fad.php on line 36
Key=[1][1], value = [1]
Notice: Undefined offset: 2 in /home/DerAlSem/programs/apache/htdocs/fad.php on line 36
Key=[2][1], value = [1]
Notice: Undefined offset: 3 in /home/DerAlSem/programs/apache/htdocs/fad.php on line 36
Key=[3][1], value = [1]
Notice: Undefined offset: 1 in /home/DerAlSem/programs/apache/htdocs/fad.php on line 36
Key=[1][2], value = [2]
Notice: Undefined offset: 2 in /home/DerAlSem/programs/apache/htdocs/fad.php on line 36
Key=[2][2], value = [2]
Notice: Undefined offset: 3 in /home/DerAlSem/programs/apache/htdocs/fad.php on line 36
ну и т.д
не могу понять, че за фигня... вроде по докам - должно работать. :(