Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## test.php
- <?php
- $xml = new SimpleXMLElement(file_get_contents('test.xml'));
- foreach ($xml->movie as $movie) {
- echo $movie->plot . "\r\n";
- }
- ## test.xml[plain_text]
- <movies>
- <movie>
- <title>PHP: Behind the Parser</title>
- <characters>
- <character>
- <name>Ms. Coder</name>
- <actor>Onlivia Actora</actor>
- </character>
- <character>
- <name>Mr. Coder</name>
- <actor>El ActÓr</actor>
- </character>
- </characters>
- <plot>
- So, this language. It's like, a programming language. Or is it a
- scripting language? All is revealed in this thrilling horror spoof
- of a documentary.
- </plot>
- <great-lines>
- <line>PHP solves all my web problems</line>
- </great-lines>
- <rating type="thumbs">7</rating>
- <rating type="stars">5</rating>
- </movie>
- </movies>
- ## Run command [plain_text]
- -bash-3.2$ php test.php
- So, this language. It's like, a programming language. Or is it a
- scripting language? All is revealed in this thrilling horror spoof
- of a documentary.
Add Comment
Please, Sign In to add comment