<?php $content = '<?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <exp:Input xmlns:exp="http://xps.com"> <exp:serviceId>namesurname</exp:serviceId> <exp:data> <exp:xml>coded</exp:xml> </exp:data> </exp:Input> </soapenv:Body> </soapenv:Envelope>'; $content = str_replace(['soapenv:', 'exp:'], '', $content); $xml = new SimpleXMLElement($content); $serviceId = $xml->Body->Input->serviceId; echo $serviceId;
You have javascript disabled. You will not be able to edit any code.