Select last element after Split in PHP
php explode end
$url = explode("/", URL::current());
echo end($url);
The PHP
explode()
function returns an array of strings by splitting a string by a separator. The following shows the syntax of the explode()
function:explode ( string $separator , string $string , int $limit = PHP_INT_MAX ) : array