diff options
Diffstat (limited to 'ext/simplexml/examples/book.php')
-rw-r--r-- | ext/simplexml/examples/book.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/simplexml/examples/book.php b/ext/simplexml/examples/book.php new file mode 100644 index 0000000..0416df8 --- /dev/null +++ b/ext/simplexml/examples/book.php @@ -0,0 +1,8 @@ +<?php +$books = simplexml_load_file('book.xml'); +//var_dump($books); +$books = $books->book; +foreach ($books as $book) { + echo "{$book->title} was written by {$book->author}\n"; +} +?> |