Hallo hab mal was zusammengestrickt aber ich komme im moment nicht weiter...
Es geht hier um das
foreach($xml->comment as $entry) {....
Sollte eigentlich in eine schlefe gehen und den XML abarbeiten....
Ausgabe sollte z.B so aussehen
Peter Müller 0123456
Klaus Meyer 123455
....
Es geht hier um das
foreach($xml->comment as $entry) {....
Sollte eigentlich in eine schlefe gehen und den XML abarbeiten....
Ausgabe sollte z.B so aussehen
Peter Müller 0123456
Klaus Meyer 123455
....
PHP:
$client = new SoapClient(
null,
array(
'location' => "http://fritz.box:49000/upnp/control/x_contact",
'uri' => "urn:dslforum-org:service:X_AVM-DE_OnTel:1",
'noroot' => True,
'login' => "",
'password' => "GeheiM"
)
);
$result = $client->GetPhonebook(new SoapParam(0,"NewPhonebookID"));
$xml = @simplexml_load_file($result['NewPhonebookURL']);
foreach($xml->comment as $entry) {
echo $entry->realName;
echo " - ";
echo $entry->number;
echo "\n";
}
var_dump($xml);
/*
["phonebook"]=>
object(SimpleXMLElement)#4 (4) {
["@attributes"]=>
array(2) {
["owner"]=>
string(1) "0"
["name"]=>
string(11) "Telefonbuch"
}
["timestamp"]=>
string(2) "68"
["comment"]=>
object(SimpleXMLElement)#5 (0) {
}
["contact"]=>
array(97) {
[0]=>
object(SimpleXMLElement)#6 (4) {
["category"]=>
string(1) "0"
["person"]=>
object(SimpleXMLElement)#103 (1) {
["realName"]=>
string(8) "AB Fenja"
}
["uniqueid"]=>
string(2) "68"
["telephony"]=>
object(SimpleXMLElement)#104 (3) {
["services"]=>
object(SimpleXMLElement)#105 (0) {
}
["comment"]=>
array(3) {
[0]=>
object(SimpleXMLElement)#106 (0) {
}
[1]=>
object(SimpleXMLElement)#107 (0) {
}
[2]=>
object(SimpleXMLElement)#108 (0) {
}
}
["number"]=>
array(2) {
[0]=>
string(5) "**601"
[1]=>
string(5) "**606"
}
}
}
.......
*/