3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'http://localhost/new-123-rugby/competition.php?croncode=12345678'; $array = explode('/', $string); $array[count($array) - 1] = ''; // empty the last component echo(implode('/', $array)); // join the pieces back

preferences:
46.11 ms | 402 KiB | 5 Q