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: ' . $key . ', value: ' . $val . '.....'; } ?>
based on MR9c4
Output for 4.3.0 - 7.1.0
key: 0, value: http:.....key: 1, value: .....key: 2, value: somedomain.....key: 3, value: somefolder.....key: 4, value: someresoure.....key: 5, value: somemodel.....key: 6, value: someaction.....key: 7, value: id.....