0
$response = $client->ApiCallDeatilDataFeed($params);
print_r($response);

これは出力です:

stdClass Object
(
    [ApiCallDeatilDataFeedResult] => <ApidsfsdfCustomerReport>
  <status>Success</status>
  <report_creation_time>9/23/2022 11:27:40 PM</report_creation_time>
  <tru_id>234244234</tru_id>
  <report_date startdate="9/13/2012" enddate="9/14/2012" />
  <call_data row="1">
    <call_tracking_number>2324234324234</call_tracking_number>
    <call_time>9/13/2012 3:33:46 PM</call_time>
    <call_duration>128</call_duration>
    <call_status>Answered</call_status>
    <caller_number>43434543242</caller_number>
    <caller_name></caller_name>
    <caller_address>SAN JOSE CA 95117</caller_address>
    <caller_city>SAN JOSE</caller_city>
    <caller_state>CA</caller_state>
    <caller_zip>95117</caller_zip>
    <call_record_url></call_record_url>
  </call_data>

</ApiCustomerReport>
)

上記の出力を受け取っている SOAP メソッドを使用しているときに、この形式を html テーブル形式で表示する必要があります

4

1 に答える 1

0

これを試して:

$response質問でダンプしたphpオブジェクトです。

<html>
    <head>
        <title></title>
    </head>
    <body>
        <table border="0" cellpadding="2" cellspacing="3" width="100%">
            <tr>
                <th>Call Tracking Number</th>
                <th>Call Time</th>
                <th>Call Duration</th>
                <th>Call Status</th>
                <th>Caller Number</th>
                <th>Caller Name</th>
                <th>Caller Address</th>
                <th>Caller City</th>
                <th>Caller State</th>
                <th>Caller Zip</th>
                <th>Call Record Url</th>
            </tr>
            <?php
            $xml = simplexml_load_string( $response->ApiCallDeatilDataFeedResult );
            foreach ( $xml->call_data as $data )
            {
            ?>
            <tr>
                <td><?php echo $data->call_tracking_number;?></td>
                <td><?php echo $data->call_time;?></td>
                <td><?php echo $data->call_duration;?></td>
                <td><?php echo $data->call_status;?></td>
                <td><?php echo $data->caller_number;?></td>
                <td><?php echo $data->caller_name;?></td>
                <td><?php echo $data->caller_address;?></td>
                <td><?php echo $data->caller_city;?></td>
                <td><?php echo $data->caller_state;?></td>
                <td><?php echo $data->caller_zip;?></td>
                <td><?php echo $data->call_record_url;?></td>
            </tr>
            <?php
            }
            ?>
        </table>
    </body>
</html>

お役に立てれば。

于 2012-09-17T08:01:34.747 に答える