/dev/null'; // setup the query to be run and hide error messages //echo $wmiexec."
"; exec($wmiexec,$wmiout,$execstatus); // execute the query and store output in $wmiout and return code in $execstatus $wmi_count = count($wmiout); // count the number of lines returned from wmic, saves recouting later if ($wmi_count > 0) { $names = explode('|',$wmiout[1]); // build the names list to dymanically output it $out = array(); for($i=2;$i<$wmi_count;$i++) { // dynamically manage the key:value pairs $data = explode('|',$wmiout[$i]); $j=0; foreach($data as $item) { // build the data part of the array $tmp[$names[$j++]] = trim($item); }; // and add the data to the final output array $out[] = $tmp; }; }; //print_r($out); return $out; } ?>