Ad Code

Ticker

6/recent/ticker-posts

Convert SOAP to JSON in php

Convert SOAP to JSON in php


Here we have a write function in PHP to convert soap to JSON you can use in your project to run and test to convert soap to XML.

In this post is PHP code for converting soap XML into JSON or you can another structure like an array.
function soap_to_json($soap)
    {
        list($trash,$soap)=explode('',$soap);
        list($soap,$trash)=explode('',$soap);
        unset($trash);
        $soap=str_replace('xmlns="url"','',$soap);

        $result=simplexml_load_string($soap);
        $json_soap=json_encode($result);
        echo $json_soap;
    }

Post a Comment

1 Comments


  1. My brother recommended I might like this blog. He was totally right. This post actually made my day. You can not imagine just how much time I had spent for this information! Thanks! paypal mastercard login

    ReplyDelete

Ad Code