1

I'm opening an url using my browser and got an xml response like this :

<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>cvs/1142</Key>
<RequestId>1F3326A4AAAD2459</RequestId>
<HostId>
0AL/FcwMI2ePg0WU1Cako5mDpFsxKraqXigdxnrKItD2Mf5KX91UpLIEunj2DrU4GMz/ukQQAuw=
</HostId>
</Error>

In PHP, I'm using file_get_contents($myURL), the problem is I can't get the xml response like what I got from the browser. So How to achieve this ? I just want to get the "<Message>The specified key does not exist.</Message>"

Thanks in advance

1 Answer 1

1

You can try this or this for transform xml to array. And then you can get the message by key: $arr['message']

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks... I will try ... :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.