"php - converting xml to array in php - parsing a soap xml in php and storing it in database" Code Answer

4

The best solution would be to use PHP's SoapClient class to do the call which will return you an object and then converting this object to an array, like so:

<?php
$client = new SoapClient("http://localhost/code/soap.wsdl");

// Soap call with HelloWorld() method
$something =  $client->HelloWorld(array('option1' => 'attribute1'));

// Convert object to array
$array = (array)$something;

?>

Which you can then store in the database.

By umläute on November 14 2022

Answers related to “php - converting xml to array in php - parsing a soap xml in php and storing it in database”

Only authorized users can answer the search term. Please sign in first, or register a free account.