Get just subdirectory name from a multisite URL

The only thing more efficient code-wise than your Option 2 would be this one-liner:

<?php
$dom = str_replace( "https://wordpress.stackexchange.com/", '', get_blog_details()->path );

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