//I've add some code in order to threat long device taht's cause break line. function filesystems () { $df = execute_program('df', '-kP'); $mounts = split("\n", $df); $fstype = array(); $s = execute_program('mount', '-v'); $lines = explode("\n", $s); $i = 0; while (list(, $line) = each($lines)) { $a = split(' ', $line); $fsdev[$a[0]] = $a[4]; } $FS=0; // This vraiable contain the laste device. for ($i = 1, $j = 0, $max = sizeof($mounts); $i < $max; $i++) { $ar_buf = preg_split("/\s+/", $mounts[$i], 6); if ($ar_buf[0] == "") { //If there is no device for this line, we use the device of last line. $ar_buf[0] = $FS; } if ( ! isset ($ar_buf[1]) ) {//If we have only the device, we change $FS $FS = $ar_buf[0]; continue; } if (hide_mount($ar_buf[5])) { continue; } $results[$j] = array(); $results[$j]['disk'] = $ar_buf[0]; $results[$j]['size'] = $ar_buf[1]; $results[$j]['used'] = $ar_buf[2]; $results[$j]['free'] = $ar_buf[3]; $results[$j]['percent'] = $ar_buf[4]; $results[$j]['mount'] = $ar_buf[5]; //($fstype[$ar_buf[5]]) ? $results[$j]['fstype'] = $fstype[$ar_buf[5]] : $results[$j]['fstype'] = $fsdev[$ar_buf[0]]; $results[$j]['fstype'] = $fsdev[$ar_buf[0]]; $j++; } return $results; }