Hello, first sorry for my English. I will try to explain me.
I am delevoping a web to edit a SoapUI(webservices) XML project. In this web, when someone change a response, the response is sent by Ajax by post.
I take the response and the first action is an utf8_decode
, then I do some str_replace
. Everything perfect, I've got this (in variable $content
):
<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:con="http://libMEROPE/ConsultasMEROPE">
<soapenv:header></soapenv:header>
<soapenv:body>
…
Everything perfect. Then, to validate the XML I use:
$doc = new DOMDocument();
$doc->loadXML($content);
But, it needs the XML (= $content
) to be in UTF-8, no UTF-8 DOMDocument return and error. Ok... I put before the check the next line:
$content = utf8_encode($content);
Then? No problem, check perfect. But the real result in the variable is:
<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:con="http://libMEROPE/ConsultasMEROPE">
   <soapenv:header></soapenv:header>
   <soapenv:body>
Can anybody help me with this?
PS: I had tried str_replace('Â', '', $content)
and str_replace(utf8_encode('Â'), '', $content)
and str_replace(utf8_encode(' '), '', $content)
but nothing, and few more things.