/~wmyers/code/sample.php
/~wmyers/code
sample.php
sample.php

The code for the above is:

ltrim((str_replace(dirname($_SERVER['PHP_SELF']),"",$_SERVER['PHP_SELF'])),"/\\")