- implode: documentation ( source)
- explode: documentation ( source)
<?php
$string = 'http://localhost/new-123-rugby/compet/ition.php?croncode=12345678';
$array = explode('/', $string);
$array[count($array) - 1] = ''; // empty the last component
echo(implode('/', $array)); // join the pieces back