3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://www.example.de/dashboard/2/'; $path = parse_url($url, PHP_URL_PATH); $parts = explode('/', $path); $section = $parts[1]; // "dashboard" $ending = $parts[2]; // "2" echo $section, '/', $ending;

preferences:
126.9 ms | 405 KiB | 5 Q