Advertisement
Adam_Martin

Untitled

Feb 14th, 2012
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1.     public function updateAction()
  2.     {
  3.         $id = $_GET['id'];
  4.         $value = $_GET['name'];
  5.  
  6.         $xml = new SimpleXMLElement('data/test.xml', null, true);
  7.         $result = $xml->xpath('//level[@id="' . $id . '"]');
  8.         $result[0]['name'] = $value;
  9.         $xml->asXml("data/test.xml");
  10.  
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement