<?php
$getConnectionCountsPage = file_get_contents('http://10.57.180.171/getconnectioncounts');
$xml=simplexml_load_string($getConnectionCountsPage) or die("Error: Cannot create object");
foreach ($xml->VHost->ConnectionsCurrent as $child)
{
        echo $child;
}
?>

這個例子會將整個XML裡找到VHost,再從VHost裡找到ConnectionsCurrent,然後取值

 

arrow
arrow

    痞客興 發表在 痞客邦 留言(0) 人氣()