3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = "balıkesir:şanlıurfa:statyum-ankara kırıkkale:kocaeli:statyum-ankara van:mardin:statyum-ankara ağrı:trabzon:statyum-ankara elazığ:hatay:statyum-ankara"; $list = explode(PHP_EOL, $data); foreach($list as $l) { $items = explode(":", $l); if (count($items) > 0 ) { echo $items[2] . "#" . $items[0] . ":" . $items[1] . "\n"; } } ?>
Output for 5.6.40, 8.1.23 - 8.1.31, 8.2.10 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
statyum-ankara#balıkesir:şanlıurfa statyum-ankara#kırıkkale:kocaeli statyum-ankara#van:mardin statyum-ankara#ağrı:trabzon statyum-ankara#elazığ:hatay

preferences:
64.33 ms | 406 KiB | 5 Q