I have an XML file that I fetch from an external server(via curl), but for some reason it’s corrupted and SimpleXML goes crazy and shoots errors everytime i try to parse it, even if it’s in a string. So, I decided I might try to get the specific part of the XML file i need:
<codes>
<code1code>There is no Code available.</code1code>
<code2text>Please try again later.</code2text>
</codes>
How can I do this? I’ve tried substr, preg_match, str_replace, and I’ve searched everywhere but none of the solutions work! please help me out, thanks!
Yoy mean something like that
Notice that
testtag is not closed, but any errors are suppresed.