0

Trying to consume SOAP webservice in php. Getting following response after execution of php file:

    {"d":{"__type":"BBDetail","BBCustomerDetails":[{"userId":"xyz","customerName":"Anil","MobileNo":"9675483219","Addressline":"8, Highland Park, Mumbai, India","currentplan":"UnlimitedBB",
"PlanExpirydate":"\/Date(1556216940000)\/","Acct_Status":"Active","AuthenticationType":null,"MAC_ID":"00:22:2D:94:79:ED","Device_Type":"Router",
"Email_Id":"xyz@yahoo.com"}],"extTransactionId":"-99999","transactionId":3278125,"returnCode":0,"returnMessage":"Success"}}

I want to store each value in php variable in order use it further. Like MobileNo, userId, Email_Id etc.

Krish
  • 39
  • 6
  • 1
    Please, take a few moments to read [how to ask useful questions](https://stackoverflow.com/help/mcve). – LMC Feb 06 '18 at 13:05
  • Gone through existing questions but couldn't figure out how to store each value in php variable. I'm new to SOAP and webservices. – Krish Feb 06 '18 at 13:44
  • Added following code and getting required fields. Is this approach right ? $response = curl_exec($curl); $keywords = preg_split("/[[]+/", $response); $data=$keywords[1]; $final = preg_split("/[]]+/", $data); $api=$final[0]; extract(json_decode($api, true)); echo $MobileNo; – Krish Feb 07 '18 at 11:13

0 Answers0