3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $url = "http://somedomain/somefolder/someresoure/somemodel/someaction/id?option=1&sales=4%206"; $apart = explode('/',$url); foreach ($apart as $key => $val) { echo 'key: ' . $key . ', value: ' . $val . '.....'; } print_r(parse_url($url)); ?>
based on HKX0u
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.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?option=1&sales=4%206.....Array ( [scheme] => http [host] => somedomain [path] => /somefolder/someresoure/somemodel/someaction/id [query] => option=1&sales=4%206 )