$dom = new DOMDocument(); @$dom->loadXML($xml); $xpath = new DOMXPath($dom); $search_name = 'zahlio'; $items = $xpath->query('/WowzaMediaServer/VHost/Application[Name="' . $search_name . '"]/ApplicationInstance/Stream[Name="' . $search_name . '"]'); for ($i = 0; $i < $items->length; $i++) { $temp = $xpath->query('SessionsFlash', $items->item($i)); $SessionsFlash = $temp->item(0)->nodeValue; echo $SessionsFlash; }
$ch = curl_init('http://user:pwd@website.net:8086/connectioncounts'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); $xml = curl_exec($ch);