]> granicus.if.org Git - php/commitdiff
add sample file
authorSterling Hughes <sterling@php.net>
Mon, 19 May 2003 01:56:14 +0000 (01:56 +0000)
committerSterling Hughes <sterling@php.net>
Mon, 19 May 2003 01:56:14 +0000 (01:56 +0000)
ext/simplexml/book.php [new file with mode: 0644]
ext/simplexml/book.xml [new file with mode: 0644]

diff --git a/ext/simplexml/book.php b/ext/simplexml/book.php
new file mode 100644 (file)
index 0000000..762f855
--- /dev/null
@@ -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/book.xml b/ext/simplexml/book.xml
new file mode 100644 (file)
index 0000000..ea40508
--- /dev/null
@@ -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>