array('pipe', 'w'), 2 => array('pipe', 'w')), $io); /* Read output sent to stdout. */ while (!feof($io[1])) { $output .= htmlspecialchars(fgets($io[1]), ENT_COMPAT, 'UTF-8'); } /* Read output sent to stderr. */ while (!feof($io[2])) { $output .= htmlspecialchars(fgets($io[2]), ENT_COMPAT, 'UTF-8'); } fclose($io[1]); fclose($io[2]); proc_close($p); //echo('
'.$output.'
'); $line = explode("HOSTNAME", $output); //print_r($line); $spaces = explode(" ", $line[1]); $no_procs = $spaces[40]; $ve_status = $spaces[41]; $ve_mainip = $spaces[42]; $ve_hname = $spaces[44]; echo "
VPS Status: $ve_status Master IP: $ve_mainip
Running Processes: $no_procs Hostname: $ve_hname
"; ?>