]> granicus.if.org Git - php/commitdiff
add an example of modifying the XML tree
authorSterling Hughes <sterling@php.net>
Wed, 21 May 2003 14:06:00 +0000 (14:06 +0000)
committerSterling Hughes <sterling@php.net>
Wed, 21 May 2003 14:06:00 +0000 (14:06 +0000)
ext/simplexml/examples/security.php [new file with mode: 0644]
ext/simplexml/examples/security.xml [new file with mode: 0644]

diff --git a/ext/simplexml/examples/security.php b/ext/simplexml/examples/security.php
new file mode 100644 (file)
index 0000000..ef5f20c
--- /dev/null
@@ -0,0 +1,6 @@
+<?php
+$s = simplexml_load_file('security.xml');
+echo $s->id;
+$s->id = 20;
+simplexml_save_file($s, 'security.new.xml');
+?>
diff --git a/ext/simplexml/examples/security.xml b/ext/simplexml/examples/security.xml
new file mode 100644 (file)
index 0000000..d954a02
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<security>
+ <id>15</id>
+</security>