mardi 10 octobre 2017

Remove starting tags from an xml string in php

I have a URL like

http://ift.tt/2yVjuMd

which returns an xml string, now I want to remove the starting tags of this xml string and store the rest of the xml string in a variable.

EDIT 0:

<!-- begin snippet: js hide: false console: true babel: false -->

Currently this is the xml string that is getting returned from the URL.

EDIT:1

    <record xmlns="http://ift.tt/1sMy6Fc">
<leader>01618cam a2200385 i 4500</leader>
<controlfield tag="001">18265203</controlfield>
<controlfield tag="005">20160810164742.0</controlfield>
<controlfield tag="008">140812s2015 nyu 000 1 eng</controlfield>
<datafield tag="906" ind1=" " ind2=" ">
<subfield code="a">7</subfield>
<subfield code="b">cbc</subfield>
<subfield code="c">orignew</subfield>
<subfield code="d">1</subfield>
<subfield code="e">ecip</subfield>
<subfield code="f">20</subfield>
<subfield code="g">y-gencatlg</subfield>
</datafield>
<datafield tag="925" ind1="0" ind2=" ">
<subfield code="a">Acquire</subfield>
<subfield code="b">1 shelf copy</subfield>
<subfield code="x">policy default</subfield>
</datafield>
</record>

This is the desired result that i want to get stored in the xml variable in php.

Aucun commentaire:

Enregistrer un commentaire