If you don't mind using ?username, then:
some-link.php?username=TestUser
Would become:
$username = $_GET['username'];
If, on the other hand, you want to have the /username, then you'd need to check the request URL:
$raw = $_SERVER['REQUEST_URI'];
$parts = explode('/', $raw);
$username = $parts[1];