3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $url = "http://somedomain/somefolder/someresoure/somemodel/someaction/id"; $apart = explode('/',$url); foreach ($apart as $key => $val) { echo $key . ', ' . $val . '</br>'; } ?>
based on CfLWI
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
0, http:</br>1, </br>2, somedomain</br>3, somefolder</br>4, someresoure</br>5, somemodel</br>6, someaction</br>7, id</br>