[ create a new paste ] login | about

Link: http://codepad.org/VRe8KIMl    [ raw code | output | fork ]

PHP, pasted on Mar 7:
<?
$xmlString = '
<temporary>
  <users>
    <temp>
      <id>1</id>
      <title> Undercover</title>
      <author>Wiwit</author>
    </temp>
    <nissi>
      <confirm>3977678bce8515e8cdbfa64850904ad1</confirm>
      <firstname>hi</firstname>
      <lastname>hhey</lastname>
      <day>1</day>
    </nissi>
   </users>
</temporary>
';

$user="nissi";
$xml = simplexml_load_string($xmlString) 
       or die("Error: Cannot create object");
unset($xml->users->$user);
echo $xml->asXML();


Output:
1
2
3
4
5
6
7
8
9
10
11
<?xml version="1.0"?>
<temporary>
  <users>
    <temp>
      <id>1</id>
      <title> Undercover</title>
      <author>Wiwit</author>
    </temp>
    
   </users>
</temporary>


Create a new paste based on this one


Comments: