Hi,
I have a doubt as if i have a "xml format" text message in my email body then how can i cobert it into an array so that i can fetch each node form it
for example:
my email body containts xml format:

<?xml version="1.0" ?>
<candidate>
<name>Superduper automation</name>
<email>yogesh@gmail.com</email>
<explevel>1</explevel>
<skillset>super automation</skillset>
<track>Tester</track>
</candidate>

like this.
now I want to fetch <name> , <email> etc values seperatly. so how can i do that?
(dont forget that xml code is in my email body part!

Sorry to both of you, i forgot to tell you that am a new/fresh user in PHP.
buts its not working properly and its taking as empty input.
@ adam.adaski: soory, but the user u have mentioned here is (I think) using already created .xml file.
but in my condition it will not work since Here xml code is in body only. it is not in any file (or attachment)
for this even i tried to fetch a body part by using

imap_fetchbody($inbox,$email_number,1.2)

function. and created file having extension as '.xml' (suppose its 'simple.xml') and saved into it.
but it is giving u as in HTML format. like-

<?xml version="1.0" ?><br><candidate><br>    <name>Superduper automation</name><br>    <email><a href="mailto:yogesh@gmail.com" target="_blank">yogesh@gmail.com</a></email><br>  <explevel>1-2</explevel><br>    <skillset>super automation</skillset><br>    <track>Tester</track><br></candidate>

So is there any function which does save simple.xml file exact as

<?xml version="1.0" ?>
    <candidate>
    <name>Superduper automation</name>
    <email>yogesh@gmail.com</email>
    <explevel>1</explevel>
    <skillset>super automation</skillset>
    <track>Tester</track>
    </candidate>

but not in html format as i have written above, so that i can use same function in other programs also.
please correct me if am wrong .
and drag me out from this problem.
or suggest me with other solution fron which i will be able to fetch 'candidate', 'name' , 'email' etc and able to form a database according to these attributes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.