summaryrefslogtreecommitdiff
path: root/ext/simplexml/examples
diff options
context:
space:
mode:
authorSterling Hughes <sterling@php.net>2003-05-21 14:06:00 (GMT)
committerSterling Hughes <sterling@php.net>2003-05-21 14:06:00 (GMT)
commitc418dd14b5852e89e7666a825bf3dd2a441d022b (patch)
tree8627a99065e0d795a1baac4971d765b3dd8a49df /ext/simplexml/examples
parent2d1a6e5dc23ace4583ee2e6f8b55c1ef21f06803 (diff)
downloadphp-c418dd14b5852e89e7666a825bf3dd2a441d022b.tar.gz
add an example of modifying the XML tree
Diffstat (limited to 'ext/simplexml/examples')
-rw-r--r--ext/simplexml/examples/security.php6
-rw-r--r--ext/simplexml/examples/security.xml4
2 files changed, 10 insertions, 0 deletions
diff --git a/ext/simplexml/examples/security.php b/ext/simplexml/examples/security.php
new file mode 100644
index 0000000..ef5f20c
--- /dev/null
+++ b/ext/simplexml/examples/security.php
@@ -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
index 0000000..d954a02
--- /dev/null
+++ b/ext/simplexml/examples/security.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<security>
+ <id>15</id>
+</security>