<?php
$xml = <<<XML
<categories>
<category>Landscape</category>
<category>Wildlife</category>
<category>Action/Sports</category>
<category>Portrait</category>
<category>Architectural</category>
<category>Wedding</category>
<category>Events</category>
<category>Fashion</category>
<category>Macro</category>
<category>Family</category>
<category>Baby</category>
<category>Abstract</category>
<category>Bodyscape</category>
<category>Forced Perspective</category>
<category>Modeling</category>
</categories>
XML;
$categories = (array)simplexml_load_string($xml, 'SimpleXMLElement')->category;
sort($categories);
foreach ($categories as $category) {
echo $category , "\n";
}
- Output for 7.1.25 - 7.1.30, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
- Abstract
Action/Sports
Architectural
Baby
Bodyscape
Events
Family
Fashion
Forced Perspective
Landscape
Macro
Modeling
Portrait
Wedding
Wildlife
preferences:
139.4 ms | 408 KiB | 5 Q