children() as $child) { foreach ($child->children() as $data) { array_push($rsp, "$data"); } } } // Reply in the form of JSON $rtn = array("rsp" => $rsp, "msg" => $msg); echo json_encode($rtn); } /** * Extract the output for a webrun command * * @param $xml The XML output from docmd() * @return An array containing the output */ function extractWebrun($xml) { $rsp = array(); $i = 0; // Extract data returned foreach($xml->children() as $nodes){ foreach($nodes->children() as $node){ // Get the node name $name = $node->name; // Get the content $status = $node->data->contents; // Add to return array $rsp[$i] = array("$name", "$status"); $i++; } } return $rsp; } /** * Extract the output for a extnoderange command * * @param $xml The XML output from docmd() * @return The nodes and groups */ function extractExtnoderange($xml) { $rsp = array(); // Extract data returned foreach ($xml->xcatresponse->intersectinggroups as $group) { array_push($rsp, "$group"); } return $rsp; } ?>