API Documentation RunningExample domain.get domain order details PHP

Aus EUserv Wiki

(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „back to API Documentation = domain.get_domain_order_details = <nowiki> <?php //includes the class library include_once("lib/xmlrpc.inc"); $xmlrpc_internalen…“)
 
(Der Versionsvergleich bezieht 2 dazwischenliegende Versionen mit ein.)
Zeile 1: Zeile 1:
-
back to [[API Documentation]]
+
back to [[API_Documentation#PHP_EXAMPLE_15|API Documentation]]
= domain.get_domain_order_details =
= domain.get_domain_order_details =
 +
   <nowiki>
   <nowiki>
<?php
<?php
 +
//includes the class library
//includes the class library
include_once("lib/xmlrpc.inc");
include_once("lib/xmlrpc.inc");
$xmlrpc_internalencoding = 'UTF-8';
$xmlrpc_internalencoding = 'UTF-8';
 +
$host="api.test.euserv.net";
$host="api.test.euserv.net";
$port=443;
$port=443;
Zeile 12: Zeile 15:
$api_path="/";
$api_path="/";
$order_id=1337;
$order_id=1337;
 +
//defines the function
//defines the function
function domain_get_domain_order_details($host,$port,$username,$password,$api_path,$order_id)
function domain_get_domain_order_details($host,$port,$username,$password,$api_path,$order_id)
{
{
-
//creates the serverurl
+
 
-
$serverurl = 'https://'.$host.':'.$port.'/'.$api_path;
+
  //creates the serverurl
-
//----------creates the message which will be send to the server----------
+
  $serverurl = 'https://'.$host.':'.$port.'/'.$api_path;
-
//creates the request for the XML-RPC Server
+
 
-
$request = new xmlrpcmsg('domain.get_domain_order_details');
+
  //----------creates the message which will be send to the server----------
-
//adds parameters to the request
+
 
-
$request->addParam
+
  //creates the request for the XML-RPC Server
-
(
+
  $request = new xmlrpcmsg('domain.get_domain_order_details');
-
//creates a value of type struct which contains an array with the username and password
+
 
-
new xmlrpcval
+
  //adds parameters to the request
-
(
+
  $request->addParam
-
array
+
    (
-
(
+
   
-
//creates a value of type string which contains the "$username"
+
    //creates a value of type struct which contains an array with the username and password
-
'login' => new xmlrpcval($username, 'string'),
+
    new xmlrpcval
-
//creates a value of type string which contains the "$password"
+
      (
-
'password' => new xmlrpcval($password, 'string'),
+
      array
-
//creates a value
+
 
-
'order_id' => new xmlrpcval($order_id, 'int'),
+
      (
-
)
+
        //creates a value of type string which contains the "$username"
-
,'struct'
+
        'login' => new xmlrpcval($username, 'string'),
-
)
+
       
-
);
+
        //creates a value of type string which contains the "$password"
-
//----------creates the XML-RPC client which represent a client of an XML-RPC server----------
+
        'password' => new xmlrpcval($password, 'string'),
-
//creates the client
+
     
-
$client = new xmlrpc_client($serverurl);
+
        //creates a value
-
//disable SSL Keycheck
+
        'order_id' => new xmlrpcval($order_id, 'int'),
-
$client->setSSLVerifyPeer(0);
+
     
-
//----------sends the request to the server and gets the response----------
+
      )
-
//sends the request via https and writes it into $response. timeout is set to 0
+
      ,'struct'
-
$response = $client->send($request,0,'https');
+
      )
-
//generates a storable representation of $response and writes it into $result_xml
+
    );
-
//echo $response->serialize();
+
 
-
//checks the response. if the method "faultCode" returns zero, the response was succesfull
+
  //----------creates the XML-RPC client which represent a client of an XML-RPC server----------
-
if (0==$response->faultCode())
+
 
-
{
+
  //creates the client
-
//returns the value sent by the server
+
  $client = new xmlrpc_client($serverurl);
-
$value = $response->value();
+
 
-
//returns the actual PHP-language value of "value"
+
  //disable SSL Keycheck
-
$result_obj = $value->scalarval();
+
  $client->setSSLVerifyPeer(0);
-
//destroys "value"
+
 
-
unset($value);
+
  //----------sends the request to the server and gets the response----------
-
}
+
 
-
else
+
  //sends the request via https and writes it into $response. timeout is set to 0
-
{
+
  $response = $client->send($request,0,'https');
-
//returns the faultCode and the faultString
+
 
-
return $error = array ( 'faultCode' => $response->faultCode(), 'faultString' => $response->faultString());
+
  //generates a storable representation of $response and writes it into $result_xml
-
}
+
  //echo $response->serialize();
-
//destroys "client"
+
 
-
unset($client);
+
  //checks the response. if the method "faultCode" returns zero, the response was succesfull
-
//destroys "response"
+
  if (0==$response->faultCode())  
-
unset($response);
+
  {
-
//----------reads the result_obj----------
+
    //returns the value sent by the server
-
//if result_obj is set then it returns the actual PHP-language value of "result_obj"
+
    $value = $response->value();
-
if (isset($result_obj['status']))
+
     
-
{
+
    //returns the actual PHP-language value of "value"
-
$value['status'] = $result_obj['status']->scalarval();
+
    $result_obj = $value->scalarval();
-
}
+
     
-
if (isset($result_obj['domain_order_details']))
+
    //destroys "value"
-
{
+
    unset($value);    
-
//resets the internal pointer for structEach() to the beginning of the struct
+
  }
-
$result_obj['domain_order_details']->structreset();
+
  else
-
//reads the keys and values and list returns an array. if no keys and values are read out list returns no array and the while-loop
+
  {
-
stops execution
+
    //returns the faultCode and the faultString
-
while (list($keyname, $data) = $result_obj['domain_order_details']->structEach())
+
    return $error = array ( 'faultCode' => $response->faultCode(), 'faultString' => $response->faultString());
-
{
+
  }
-
#--->FIRST DIMENSION<---
+
   
-
$domain_order_numbers[$keyname] = $data->scalarval();
+
  //destroys "client"
-
$domaindaten = $domain_order_numbers[$keyname];
+
  unset($client);
-
$z=0;
+
   
-
//gets the array_keys(members)
+
  //destroys "response"
-
$domainkeys = array_keys($domaindaten);
+
  unset($response);
-
//counts the arraykeys, the number of arraykeys will be used in the do-while construct
+
 
-
$anzahldomainkeys = count($domainkeys);
+
  //----------reads the result_obj----------
-
do
+
   
-
{
+
  //if result_obj is set then it returns the actual PHP-language value of "result_obj"
-
//reads the first dimension and writes the result in an array
+
   
-
$arraydomaindata[$keyname][$domainkeys[$z]] = $domaindaten[$domainkeys[$z]]->scalarval();
+
  if (isset($result_obj['status']))
-
$z=$z+1;
+
  {
-
}
+
    $value['status'] = $result_obj['status']->scalarval();
-
while($z<$anzahldomainkeys);
+
  }
-
}
+
 
-
//gets the array_keys(members) of "daten"
+
  if (isset($result_obj['domain_order_details']))
-
$daten = $arraydomaindata;
+
  {
-
$domainkeys = array_keys($daten);
+
     
-
$k=0;
+
    //resets the internal pointer for structEach() to the beginning of the struct
-
$anzahldomainorder = count($domainkeys);
+
    $result_obj['domain_order_details']->structreset();
-
#READS THE DATA AND WRITES IT INTO AN ARRAY
+
   
-
do
+
    //reads the keys and values and list returns an array. if no keys and values are read out list returns no array and the while-loop stops execution
-
{
+
    while (list($keyname, $data) = $result_obj['domain_order_details']->structEach())
-
#--->SECOND DIMENSION<---
+
    {
-
$x=0;
+
      #--->FIRST DIMENSION<---
-
$arraykeys1 = array_keys($daten[$domainkeys[$k]]);
+
      $domain_order_numbers[$keyname] = $data->scalarval();
-
$anzahlkeys1 = count($arraykeys1);
+
      $domaindaten = $domain_order_numbers[$keyname];
-
do
+
      $z=0;
-
{
+
     
-
#--->THIRD DIMENSION<---
+
      //gets the array_keys(members)
-
//if value is an array then read each value of this array
+
      $domainkeys = array_keys($domaindaten);
-
if($arraykeys1[$x]=="dns_record_type" OR $arraykeys1[$x]=="redirect_record_type")
+
     
-
{
+
      //counts the arraykeys, the number of arraykeys will be used in the do-while construct
-
$y=0;
+
      $anzahldomainkeys = count($domainkeys);
-
$arraykeys2 = array_keys($daten[$domainkeys[$k]][$arraykeys1[$x]]);
+
      do
-
$anzahlkeys2 = count($arraykeys2);
+
      {
-
$subarray1 = $daten[$domainkeys[$k]][$arraykeys1[$x]];
+
        //reads the first dimension and writes the result in an array
-
do
+
        $arraydomaindata[$keyname][$domainkeys[$z]] = $domaindaten[$domainkeys[$z]]->scalarval();
-
{
+
        $z=$z+1;
-
#--->FOURTH DIMENSION<---
+
      }
-
$q=0;
+
      while($z<$anzahldomainkeys);
-
if($arraykeys1[$x]=="redirect_record_type")
+
    }
-
{
+
   
-
$subresultarray1[$arraykeys2[$y]] = $subarray1[$arraykeys2[$q]]->scalarval();
+
    //gets the array_keys(members) of "daten"
-
}
+
    $daten = $arraydomaindata;
-
else
+
    $domainkeys = array_keys($daten);
-
{
+
    $k=0;
-
$arraykeys3 = array_keys($subarray1[$arraykeys2[$y]]->scalarval());
+
    $anzahldomainorder = count($domainkeys);
-
$anzahlkeys3 = count($arraykeys3);
+
 
-
$subarray2 = $subarray1[$arraykeys2[$y]]->scalarval();
+
    #READS THE DATA AND WRITES IT INTO AN ARRAY
-
do
+
    do
-
{
+
    {  
-
#--->FIFTH DIMENSION<---
+
      #--->SECOND DIMENSION<---
-
$subresultarray[$arraykeys2[$y]][$arraykeys3[$q]] = $subarray2[$arraykeys3[$q]]->scalarval();
+
 
-
$q=$q+1;
+
      $x=0;
-
}
+
      $arraykeys1 = array_keys($daten[$domainkeys[$k]]);
-
while($q<$anzahlkeys3);
+
      $anzahlkeys1 = count($arraykeys1);
-
}
+
   
-
$y=$y+1;
+
      do
-
}
+
      {
-
while($y<$anzahlkeys2);
+
        #--->THIRD DIMENSION<---
-
if($arraykeys1[$x]=="redirect_record_type")
+
   
-
{
+
        //if value is an array then read each value of this array
-
$resultarray[$domainkeys[$k]][$arraykeys1[$x]] = $subresultarray1;
+
        if($arraykeys1[$x]=="dns_record_type" OR $arraykeys1[$x]=="redirect_record_type")
-
}
+
        {
-
else
+
          $y=0;
-
{
+
          $arraykeys2 = array_keys($daten[$domainkeys[$k]][$arraykeys1[$x]]);
-
$resultarray[$domainkeys[$k]][$arraykeys1[$x]] = $subresultarray;
+
          $anzahlkeys2 = count($arraykeys2);
-
}
+
          $subarray1 = $daten[$domainkeys[$k]][$arraykeys1[$x]];  
-
}
+
-
else
+
          do
-
{
+
          {
-
$resultarray[$domainkeys[$k]][$arraykeys1[$x]] = $daten[$domainkeys[$k]][$arraykeys1[$x]];
+
            #--->FOURTH DIMENSION<---
-
}
+
            $q=0;
-
$x=$x+1;
+
 
-
}
+
            if($arraykeys1[$x]=="redirect_record_type")
-
while($x<$anzahlkeys1);
+
            {
-
$k=$k+1;
+
              $subresultarray1[$arraykeys2[$y]] = $subarray1[$arraykeys2[$q]]->scalarval();
-
}
+
            }
-
while($k<$anzahldomainorder);
+
            else
-
//writes the array into the array "value"
+
            {
-
$value['domain_order_details'] = $resultarray;
+
              $arraykeys3 = array_keys($subarray1[$arraykeys2[$y]]->scalarval());
-
}
+
              $anzahlkeys3 = count($arraykeys3);
-
return $value;
+
              $subarray2 = $subarray1[$arraykeys2[$y]]->scalarval();
 +
         
 +
              do
 +
              {
 +
                #--->FIFTH DIMENSION<---
 +
                $subresultarray[$arraykeys2[$y]][$arraykeys3[$q]] = $subarray2[$arraykeys3[$q]]->scalarval();
 +
         
 +
                $q=$q+1;
 +
              }
 +
              while($q<$anzahlkeys3);
 +
            }
 +
          $y=$y+1;
 +
          }
 +
          while($y<$anzahlkeys2);
 +
     
 +
          if($arraykeys1[$x]=="redirect_record_type")
 +
          {
 +
            $resultarray[$domainkeys[$k]][$arraykeys1[$x]] = $subresultarray1;
 +
          }
 +
          else
 +
          {
 +
            $resultarray[$domainkeys[$k]][$arraykeys1[$x]] = $subresultarray;
 +
          }
 +
        }
 +
        else
 +
        {
 +
          $resultarray[$domainkeys[$k]][$arraykeys1[$x]] = $daten[$domainkeys[$k]][$arraykeys1[$x]];
 +
        }
 +
        $x=$x+1;
 +
      }
 +
      while($x<$anzahlkeys1);
 +
      $k=$k+1;
 +
    }
 +
    while($k<$anzahldomainorder);
 +
   
 +
    //writes the array into the array "value"
 +
    $value['domain_order_details'] = $resultarray;
 +
  }
 +
  return $value;  
}
}
 +
//calls the function
//calls the function
$result = domain_get_domain_order_details($host,$port,$username,$password,$api_path,$order_id);
$result = domain_get_domain_order_details($host,$port,$username,$password,$api_path,$order_id);
 +
if(0==$result['faultCode'])
if(0==$result['faultCode'])
{
{
-
echo "Status: ".$result['status']."<br><br>";
+
  echo "Status: ".$result['status']."<br><br>";
-
//writes the array into "daten"
+
 
-
$data = $result["domain_order_details"];
+
  //writes the array into "daten"
-
//gets the array_keys(members)
+
  $data = $result["domain_order_details"];
-
$domainkeys = array_keys($data);;
+
 
-
$k=0;
+
  //gets the array_keys(members)
-
$anzahldomainorder = count($domainkeys);
+
  $domainkeys = array_keys($data);;
-
//AN EXAMPLE HOW YOU CAN READ THE DATA OUT OF THE ARRAY
+
 
-
//the array will be readed in the same procedure like it was already done in the function
+
  $k=0;
-
//the main difference is that it outputs the data instead of writes it into an array
+
  $anzahldomainorder = count($domainkeys);
 +
 
 +
  //AN EXAMPLE HOW YOU CAN READ THE DATA OUT OF THE ARRAY
 +
  //the array will be readed in the same procedure like it was already done in the function
 +
  //the main difference is that it outputs the data instead of writes it into an array
do
do
{
{
-
echo " <u><h2>".$domainkeys[$k]."</h2></u>";
+
  echo " <u><h2>".$domainkeys[$k]."</h2></u>";
-
$x=0;
+
 
-
$arraykeys1 = array_keys($data[$domainkeys[$k]]);
+
  $x=0;
-
$anzahlkeys1 = count($arraykeys1);
+
  $arraykeys1 = array_keys($data[$domainkeys[$k]]);
-
#--->THIRD DIMENSION<---
+
  $anzahlkeys1 = count($arraykeys1);
-
do
+
 
-
{
+
  #--->THIRD DIMENSION<---
-
//if value is an array then read each value of this array
+
  do
-
if($arraykeys1[$x]=="dns_record_type" OR $arraykeys1[$x]=="redirect_record_type")
+
  {
-
{
+
    //if value is an array then read each value of this array
-
$y=0;
+
    if($arraykeys1[$x]=="dns_record_type" OR $arraykeys1[$x]=="redirect_record_type")
-
$arraykeys2 = array_keys($data[$domainkeys[$k]][$arraykeys1[$x]]);
+
    {
-
$anzahlkeys2 = count($arraykeys2);
+
      $y=0;
-
$subarray1 = $data[$domainkeys[$k]][$arraykeys1[$x]];
+
      $arraykeys2 = array_keys($data[$domainkeys[$k]][$arraykeys1[$x]]);
-
echo "<strong><u>".$arraykeys1[$x]."</u></strong>";
+
      $anzahlkeys2 = count($arraykeys2);
-
#--->FOURTH DIMENSION<---
+
      $subarray1 = $data[$domainkeys[$k]][$arraykeys1[$x]];
-
do
+
      echo "<strong><u>".$arraykeys1[$x]."</u></strong>";
-
{
+
      #--->FOURTH DIMENSION<---
-
$q=0;
+
      do
-
#--->FIFTH DIMENSION<---
+
      {
-
if($arraykeys1[$x]=="redirect_record_type")
+
        $q=0;
-
{
+
        #--->FIFTH DIMENSION<---
-
echo "<br><u>".$arraykeys2[$y]."</u>";
+
 
-
echo ": ".$subarray1[$arraykeys2[$q]]."<br>";
+
        if($arraykeys1[$x]=="redirect_record_type")
-
}
+
        {
-
else
+
          echo "<br><u>".$arraykeys2[$y]."</u>";
-
{
+
          echo ": ".$subarray1[$arraykeys2[$q]]."<br>";
-
$arraykeys3 = array_keys($subarray1[$arraykeys2[$y]]);
+
        }
-
$anzahlkeys3 = count($arraykeys3);
+
        else
-
$subarray2 = $subarray1[$arraykeys2[$y]];
+
        {
-
echo "<br><u>".$arraykeys2[$y]."</u><br>";
+
          $arraykeys3 = array_keys($subarray1[$arraykeys2[$y]]);
-
do
+
          $anzahlkeys3 = count($arraykeys3);
-
{
+
          $subarray2 = $subarray1[$arraykeys2[$y]];
-
echo $arraykeys3[$q].": ".$subarray2[$arraykeys3[$q]]."<br>";
+
          echo "<br><u>".$arraykeys2[$y]."</u><br>";
-
$q=$q+1;
+
          do
-
}
+
          {
-
while($q<$anzahlkeys3);
+
            echo $arraykeys3[$q].": ".$subarray2[$arraykeys3[$q]]."<br>";
-
}
+
            $q=$q+1;
-
$y=$y+1;
+
          }
-
}
+
          while($q<$anzahlkeys3);
-
while($y<$anzahlkeys2);
+
        }
-
}
+
        $y=$y+1;
-
else
+
      }
-
{
+
      while($y<$anzahlkeys2);
-
echo "<strong><u>".$arraykeys1[$x]."</u></strong>: ".$data[$domainkeys[$k]][$arraykeys1[$x]]."<br><br>";
+
    }
-
}
+
    else
-
$x=$x+1;
+
    {
-
}
+
      echo "<strong><u>".$arraykeys1[$x]."</u></strong>: ".$data[$domainkeys[$k]][$arraykeys1[$x]]."<br><br>";
-
while($x<$anzahlkeys1);
+
    }
-
$k=$k+1;
+
    $x=$x+1;
 +
  }
 +
  while($x<$anzahlkeys1);
 +
  $k=$k+1;
}
}
while($k<$anzahldomainorder);
while($k<$anzahldomainorder);
 +
}
}
else
else

Aktuelle Version vom 07:49, 6. Sep. 2012

back to API Documentation

domain.get_domain_order_details

 
<?php

//includes the class library
include_once("lib/xmlrpc.inc");
$xmlrpc_internalencoding = 'UTF-8';

$host="api.test.euserv.net";
$port=443;
$username="<API_USER>";
$password="<API_USER_PASSWORD>";
$api_path="/";
$order_id=1337;

//defines the function
function domain_get_domain_order_details($host,$port,$username,$password,$api_path,$order_id)
{

  //creates the serverurl
  $serverurl = 'https://'.$host.':'.$port.'/'.$api_path;

  //----------creates the message which will be send to the server----------

  //creates the request for the XML-RPC Server
  $request = new xmlrpcmsg('domain.get_domain_order_details');
  
  //adds parameters to the request
  $request->addParam
    (
    
    //creates a value of type struct which contains an array with the username and password
    new xmlrpcval
      (
      array

      (
        //creates a value of type string which contains the "$username"
        'login' => new xmlrpcval($username, 'string'),
        
        //creates a value of type string which contains the "$password"
        'password' => new xmlrpcval($password, 'string'),
      
        //creates a value
        'order_id' => new xmlrpcval($order_id, 'int'),
      
      )
      ,'struct'
      )
    );

  //----------creates the XML-RPC client which represent a client of an XML-RPC server----------

  //creates the client
  $client = new xmlrpc_client($serverurl);
  
  //disable SSL Keycheck
  $client->setSSLVerifyPeer(0);
  
  //----------sends the request to the server and gets the response----------

  //sends the request via https and writes it into $response. timeout is set to 0
  $response = $client->send($request,0,'https');
  
  //generates a storable representation of $response and writes it into $result_xml
  //echo $response->serialize();
  
  //checks the response. if the method "faultCode" returns zero, the response was succesfull
  if (0==$response->faultCode()) 
  {
    //returns the value sent by the server
    $value = $response->value();
      
    //returns the actual PHP-language value of "value"
    $result_obj = $value->scalarval();
      
    //destroys "value"
    unset($value);      
  }
  else
  {
    //returns the faultCode and the faultString
    return $error = array ( 'faultCode' => $response->faultCode(), 'faultString' => $response->faultString());
  }
    
  //destroys "client"
  unset($client);
    
  //destroys "response"
  unset($response);  
  
  //----------reads the result_obj----------
    
  //if result_obj is set then it returns the actual PHP-language value of "result_obj"
    
  if (isset($result_obj['status']))
  {
    $value['status'] = $result_obj['status']->scalarval();
  }

  if (isset($result_obj['domain_order_details']))
  {
      
    //resets the internal pointer for structEach() to the beginning of the struct
    $result_obj['domain_order_details']->structreset();
    
    //reads the keys and values and list returns an array. if no keys and values are read out list returns no array and the while-loop stops execution
    while (list($keyname, $data) = $result_obj['domain_order_details']->structEach())
    {
      #--->FIRST DIMENSION<---
      $domain_order_numbers[$keyname] = $data->scalarval();
      $domaindaten = $domain_order_numbers[$keyname];
      $z=0;
      
      //gets the array_keys(members)
      $domainkeys = array_keys($domaindaten);
      
      //counts the arraykeys, the number of arraykeys will be used in the do-while construct
      $anzahldomainkeys = count($domainkeys);
      do
      {
        //reads the first dimension and writes the result in an array
        $arraydomaindata[$keyname][$domainkeys[$z]] = $domaindaten[$domainkeys[$z]]->scalarval();
        $z=$z+1;
      }
      while($z<$anzahldomainkeys);
    }  
    
    //gets the array_keys(members) of "daten"
    $daten = $arraydomaindata;
    $domainkeys = array_keys($daten);
    $k=0;
    $anzahldomainorder = count($domainkeys);

    #READS THE DATA AND WRITES IT INTO AN ARRAY
    do
    { 
      #--->SECOND DIMENSION<---
  
      $x=0;
      $arraykeys1 = array_keys($daten[$domainkeys[$k]]);
      $anzahlkeys1 = count($arraykeys1);
    
      do
      {
        #--->THIRD DIMENSION<---
    
        //if value is an array then read each value of this array
        if($arraykeys1[$x]=="dns_record_type" OR $arraykeys1[$x]=="redirect_record_type")
        {
          $y=0;
          $arraykeys2 = array_keys($daten[$domainkeys[$k]][$arraykeys1[$x]]);
          $anzahlkeys2 = count($arraykeys2);
          $subarray1 = $daten[$domainkeys[$k]][$arraykeys1[$x]]; 
 
          do
          {
            #--->FOURTH DIMENSION<---
            $q=0;

            if($arraykeys1[$x]=="redirect_record_type")
            {
              $subresultarray1[$arraykeys2[$y]] = $subarray1[$arraykeys2[$q]]->scalarval();
            }
            else
            {
              $arraykeys3 = array_keys($subarray1[$arraykeys2[$y]]->scalarval());
              $anzahlkeys3 = count($arraykeys3);
              $subarray2 = $subarray1[$arraykeys2[$y]]->scalarval();
          
              do
              {
                #--->FIFTH DIMENSION<---
                $subresultarray[$arraykeys2[$y]][$arraykeys3[$q]] = $subarray2[$arraykeys3[$q]]->scalarval();
          
                $q=$q+1;
              }
              while($q<$anzahlkeys3);
            }
          $y=$y+1;
          }
          while($y<$anzahlkeys2);
      
          if($arraykeys1[$x]=="redirect_record_type")
          {
            $resultarray[$domainkeys[$k]][$arraykeys1[$x]] = $subresultarray1;
          }
          else
          {
            $resultarray[$domainkeys[$k]][$arraykeys1[$x]] = $subresultarray;
          }
        }
        else
        {
          $resultarray[$domainkeys[$k]][$arraykeys1[$x]] = $daten[$domainkeys[$k]][$arraykeys1[$x]];
        }
        $x=$x+1;
      }
      while($x<$anzahlkeys1);
      $k=$k+1;
    }
    while($k<$anzahldomainorder);
    
    //writes the array into the array "value"
    $value['domain_order_details'] = $resultarray;
  }
  return $value;    
}

//calls the function
$result = domain_get_domain_order_details($host,$port,$username,$password,$api_path,$order_id);

if(0==$result['faultCode'])
{
  echo "Status: ".$result['status']."<br><br>";

  //writes the array into "daten"
  $data = $result["domain_order_details"];

  //gets the array_keys(members)
  $domainkeys = array_keys($data);;

  $k=0;
  $anzahldomainorder = count($domainkeys);

  //AN EXAMPLE HOW YOU CAN READ THE DATA OUT OF THE ARRAY
  //the array will be readed in the same procedure like it was already done in the function
  //the main difference is that it outputs the data instead of writes it into an array
do
{
  echo " <u><h2>".$domainkeys[$k]."</h2></u>";
  
  $x=0;
  $arraykeys1 = array_keys($data[$domainkeys[$k]]);
  $anzahlkeys1 = count($arraykeys1);

  #--->THIRD DIMENSION<---
  do
  {
    //if value is an array then read each value of this array
    if($arraykeys1[$x]=="dns_record_type" OR $arraykeys1[$x]=="redirect_record_type")
    {
      $y=0;
      $arraykeys2 = array_keys($data[$domainkeys[$k]][$arraykeys1[$x]]);
      $anzahlkeys2 = count($arraykeys2);
      $subarray1 = $data[$domainkeys[$k]][$arraykeys1[$x]];
      echo "<strong><u>".$arraykeys1[$x]."</u></strong>";
      #--->FOURTH DIMENSION<---
      do
      {
        $q=0;
        #--->FIFTH DIMENSION<---

        if($arraykeys1[$x]=="redirect_record_type")
        {
          echo "<br><u>".$arraykeys2[$y]."</u>";
          echo ": ".$subarray1[$arraykeys2[$q]]."<br>";
        }
        else
        {
          $arraykeys3 = array_keys($subarray1[$arraykeys2[$y]]);
          $anzahlkeys3 = count($arraykeys3);
          $subarray2 = $subarray1[$arraykeys2[$y]];
          echo "<br><u>".$arraykeys2[$y]."</u><br>";
          do
          {
            echo $arraykeys3[$q].": ".$subarray2[$arraykeys3[$q]]."<br>";
            $q=$q+1;
          }
          while($q<$anzahlkeys3);
        }
        $y=$y+1;
      }
      while($y<$anzahlkeys2);
    }
    else
    {
      echo "<strong><u>".$arraykeys1[$x]."</u></strong>: ".$data[$domainkeys[$k]][$arraykeys1[$x]]."<br><br>";
    }
    $x=$x+1;  
  }
  while($x<$anzahlkeys1);
  $k=$k+1;
}
while($k<$anzahldomainorder);

}
else
{
echo "faultCode: ".$result['faultCode']." faultString: ".$result['faultString'];
}
?>