Need to Echo A Url path to show on a wordpress page

You can find that with somthing like the following

add_shortcode( 'url_path_number', function ( $atts ) {

    // use an attribute or the current URL
    $a = shortcode_atts( array(
        'url' => get_permalink(),
    ), $atts );

    // get the path from the URL
    $path = parse_url($a['url'],PHP_URL_PATH);
    $parts = array_filter(explode("https://wordpress.stackexchange.com/", $path),function($v) { return $v !== ''; });

    // get the last dir of path
    return end($parts); 
} );

Using the shortcode will return current URL

[url_path_number]

or you can specify the URL

[url_path_number url="https://example.com/page/c/1"]

UPDATE:

to go just after the path, and not use get_permalink()

add_shortcode( 'url_path_number', function ( $atts ) {
    $a = shortcode_atts( array(
        'path' => $_SERVER['REQUEST_URI'],
    ), $atts );
    $parts = array_filter(explode("https://wordpress.stackexchange.com/",$a['path']),function($v) { return $v !== ''; });
    return end($parts); 
} );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)