summaryrefslogtreecommitdiff
path: root/ext/simplexml/examples
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2003-05-19 18:25:20 (GMT)
committerDerick Rethans <derick@php.net>2003-05-19 18:25:20 (GMT)
commitafabd0575c7abd665cf660161aab0b0ac7982452 (patch)
tree173e2f79fcc631f1b8fc4444659c3d96ca0ea06e /ext/simplexml/examples
parent80824a3d3a6fc2dfc54814124769deebd511db5b (diff)
downloadphp-afabd0575c7abd665cf660161aab0b0ac7982452.tar.gz
- Move examples to their own directory
Diffstat (limited to 'ext/simplexml/examples')
-rw-r--r--ext/simplexml/examples/book.php7
-rw-r--r--ext/simplexml/examples/book.xml10
2 files changed, 17 insertions, 0 deletions
diff --git a/ext/simplexml/examples/book.php b/ext/simplexml/examples/book.php
new file mode 100644
index 0000000..762f855
--- /dev/null
+++ b/ext/simplexml/examples/book.php
@@ -0,0 +1,7 @@
+<?php
+$books = simplexml_load_file('book.xml')->book;
+
+foreach ($books as $book) {
+ echo "{$book->title} was written by {$book->author}\n";
+}
+?>
diff --git a/ext/simplexml/examples/book.xml b/ext/simplexml/examples/book.xml
new file mode 100644
index 0000000..ea40508
--- /dev/null
+++ b/ext/simplexml/examples/book.xml
@@ -0,0 +1,10 @@
+<books>
+ <book>
+ <title>The Grapes of Wrath</title>
+ <author>John Steinbeck</author>
+ </book>
+ <book>
+ <title>The Pearl</title>
+ <author>John Steinbeck</author>
+ </book>
+</books>