<?php $source = <<<DATA <xml> <title>Test 123</title> <categories> <category>Test1</category> <category>Test2</category> </categories> </xml> DATA; $item = simplexml_load_string($source); foreach ($item->categories->category as $elm) { echo $elm . PHP_EOL; }
You have javascript disabled. You will not be able to edit any code.