Hi! Could we please enable some services and cookies to improve your experience and our website?
<?php
$url = 'https://www.domain.ru/test-url';
// using preg_match
preg_match('/(\/[^\/]+)$/', $url, $matches);
echo $matches[1].PHP_EOL;
// using parse_url
echo parse_url($url, PHP_URL_PATH);