Skip to content

Instantly share code, notes, and snippets.

@alepane21
Created March 3, 2017 15:51
Show Gist options
  • Save alepane21/46966cbb6b87ace3965221885a041905 to your computer and use it in GitHub Desktop.
Save alepane21/46966cbb6b87ace3965221885a041905 to your computer and use it in GitHub Desktop.
<?php
$data='<data>
<seg id="A1"/>
<seg id="A2"/>
<seg id="A3"/>
<seg id="A4"/>
<seg id="A5"/>
</data>';
$doc=new SimpleXMLElement($data);
$seg_ref = $doc->seg;
unset($seg_ref->{0});
echo $doc->asXml();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment